Implemented a convenient way to use ACI.dev Tools in PydanticAI

Merged
KA
1y ago
+119-11

Hi @DouweM, here is my PR implementing ACI.dev Tools within a pydantic-ai agent

This works fine. The user is required to;

  1. ACI_API_KEY. This is got from ACI.dev once you register an account
  2. An ACI function name to use i.e TAVILY__SEARCH
  3. linked_account_owner_id

Here are dependencies required to run this;

  • pydantic-ai
  • aci-sdk

Example Usage

tavily_search = tool_from_aci(
    "TAVILY__SEARCH",
    linked_account_owner_id=os.getenv('LINKED_ACCOUNT_OWNER_ID')
)

agent = Agent(
    model,
    system_prompt=(
        "
        You are a highly capable assistant. Make sure to do the tasks you're assigned to do.
        "
    ),
    tools=[tavily_search]
)

result = agent.run_sync("Search the web and tell the next match Chelsea will play and when the match is")
print(result.output)

ACI is a great platform with many amazing tools. This PR will enable to connect PydanticAI agents to 600+ integrations which is amazing.