Percolating Python-first
Most of the agentic frameworks in use today are Python-based. Many of them rely heavily on Pydantic. In this section we take a look at how Percolate and Python work together.
pip install percolate-dbimport percolate as p8
from pydantic import BaseModel,Field
import typing
from percolate.models import DefaultEmbeddingField
class MyFirstAgent(BaseModel):
"""You are an agent that provides the information you are asked and a second random fact"""
#because it has no config it will save to the public database schema
name: str = Field(description="Task name")
#the default embedding field just settgs json_schema_extra.embedding_provider so you can do that yourself
description:str = DefaultEmbeddingField(description="Task description")
@classmethod
def get_model_functions(cls):
"""i return a list of functions by key stored in the database"""
return {
'get_pet_findByStatus': "a function i used to look up petes based on their status",
}
Registering tools and adding them to your agent
Using the structured response types
Orchestration
Final thoughts
Last updated