Notebooks
W
Weaviate
Logfire Weaviate

Logfire Weaviate

vector-searchvector-databaseretrieval-augmented-generationllm-frameworksfunction-callingpydanticweaviate-recipesintegrationsPythongenerative-aillm-agent-frameworks

Open In Colab

Pydantic AI Logfire and Weaviate

This notebook was created by Connor Shorten!

Check versions of Logfire and the Weaviate Python Client

Note: This notebook was originally published with logfire==3.5.0 and weaviate-client==4.10.2

[1]
Logfire version: 3.5.0
Weaviate version: 4.10.2
[ ]
[5]
22:36:46.040 agent run prompt=How many feet are in a mile?
22:36:46.041   preparing model and tools run_step=1
22:36:46.041   model request
22:36:48.152     Pydantic nullable validate_python
22:36:48.154     Pydantic nullable validate_python
22:36:48.154     Pydantic nullable validate_python
22:36:48.157     Pydantic nullable validate_python
22:36:48.726   handle model response
There are 5,280 feet in a mile.
[7]
01:26:25.574 Pydantic _VectorizerConfigCreate validate_python
01:26:25.588 Pydantic _VectorizerConfigCreate validate_python
Connecting to Weaviate...
01:26:25.639 Pydantic ProtocolParams validate_python
01:26:25.640 Pydantic ProtocolParams validate_python
01:26:25.640 Pydantic ConnectionParams validate_python
01:26:25.641 Pydantic AdditionalConfig validate_python
01:26:25.641   Pydantic Timeout validate_python
Successfully connected to Weaviate...
[10]
[9]
[11]
'Search Result: 1:\ncourseDescription:Deep dive into neural networks, reinforcement learning, and deep learning architectures. Students will implement cutting-edge ML models and understand their theoretical foundations.courseDuration:48.0currentlyEnrolling:TruecourseTitle:Advanced Machine Learning\nSearch Result: 2:\ncourseDescription:Introduction to quantum mechanics, quantum circuits, and quantum algorithms. Covers basic principles of superposition, entanglement, and quantum gates.courseDuration:36.0currentlyEnrolling:FalsecourseTitle:Quantum Computing Fundamentals\n'
[19]
01:53:36.298 Initialize query analyzer agent
01:53:36.300 Initialize results summarizer agent
01:53:36.301 Course search workflow
01:53:36.301   Query analysis
01:53:36.301     Analyzing user request
01:53:36.301     query_analyzer run prompt=Neural Network courses
01:53:36.301       Generate analyzer system prompt
01:53:36.302       preparing model and tools run_step=1
01:53:36.302       model request
sys:1: ResourceWarning: Unclosed socket <zmq.Socket(zmq.PUSH) at 0x15fdbfc40>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
01:53:37.634         Pydantic nullable validate_python
01:53:37.635         Pydantic nullable validate_python
01:53:37.636         Pydantic nullable validate_python
01:53:37.637       handle model response
01:53:37.637         Pydantic SearchQuery validate_json
01:53:37.639   Search execution
01:53:37.639     Executing search query
01:53:39.390   Results summarization
01:53:39.391     Summarizing search results
01:53:39.391     results_summarizer run prompt=Search Result: 1:
courseDescription:Deep dive into neural netw...ntlyEnrolling:FalsecourseTitle:Quantum Computing Fundamentals

01:53:39.391       preparing model and tools run_step=1
01:53:39.392       model request
01:53:46.494         Pydantic nullable validate_python
01:53:46.495         Pydantic nullable validate_python
01:53:46.495         Pydantic nullable validate_python
01:53:46.496       handle model response
01:53:46.496         Pydantic SearchResult validate_json
01:53:46.497   Search workflow completed successfully
summary="The search results contain two courses, one on 'Advanced Machine Learning' and the other on 'Quantum Computing Fundamentals'. The Machine Learning course is currently enrolling students and will take 48 hours to complete, while the Quantum Computing course is not currently enrolling and requires 36 hours." relevant_courses=['Advanced Machine Learning', 'Quantum Computing Fundamentals'] recommendation="We recommend the 'Advanced Machine Learning' course as it is currently open for enrollment and offers in-depth knowledge on Neural Networks, Reinforcement Learning, and Deep Learning Architectures which are in-demand topics."