Add your description here
Project description
LangDB LLM for Google ADK
A Google ADK (Agent Development Kit) model implementation for LangDB's LLM API. This package provides seamless integration of LangDB's LLM capabilities into the Google ADK framework.
Features
- Native integration with Google ADK's
BaseLlminterface - Support for both streaming and non-streaming completions
- Built-in function calling support
- Integration with MCP (Model Control Protocol) servers
- Asynchronous API compatible with ADK's execution model
- Automatic handling of tool execution and responses
Installation
pip install -e .
Usage with Google ADK
Basic Usage
import os
import asyncio
from google.adk import Agent
from langdb_adk import LangDBLlm
from google.adk.runners import InMemoryRunner
async def main():
# Initialize the LangDB LLM with your credentials
llm = LangDBLlm(
model_name="anthropic/claude-sonnet-4",
api_key=os.getenv("LANGDB_API_KEY"),
project_id=os.getenv("LANGDB_PROJECT_ID")
)
# Create an ADK agent with the LangDB LLM
agent = Agent(llm=llm)
# Create a runner to execute the agent
runner = InMemoryRunner()
# Run the agent with a prompt
response = await runner.run(agent, "Hello, how are you?")
print(response.text)
if __name__ == "__main__":
asyncio.run(main())
With MCP Servers
# Configure MCP servers for LangDB
mcp_servers = [
{
"server_url": "server_url",
"type": "sse",
"name": "search",
"description": "Web search capabilities via DuckDuckGo"
}
]
async def main():
# Initialize the LangDB LLM with MCP servers
llm = LangDBLlm(
model_name="anthropic/claude-sonnet-4",
api_key=os.getenv("LANGDB_API_KEY"),
project_id=os.getenv("LANGDB_PROJECT_ID"),
mcp_servers=mcp_servers
)
# Create an ADK agent with the LangDB LLM
agent = Agent(llm=llm)
# Create a runner to execute the agent
runner = InMemoryRunner()
# Run the agent with a prompt that can use MCP tools
response = await runner.run(agent, "Search for the latest news about AI")
print(response.text)
Configuration
Environment Variables
LANGDB_API_KEY: Your LangDB API key (required)LANGDB_PROJECT_ID: Your LangDB project ID (required)
LangDBLlm Parameters
model_name: The name of the model to use (e.g., "anthropic/claude-sonnet-4")api_key: Your LangDB API keyproject_id: Your LangDB project IDextra_headers: Additional headers to include in requestsmcp_servers: List of MCP server configurations for extended capabilities
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Acknowledgements
- Google ADK Team for the Agent Development Kit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
langdb_adk-0.1.2.tar.gz
(9.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langdb_adk-0.1.2.tar.gz.
File metadata
- Download URL: langdb_adk-0.1.2.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
955107e7b99089b167202ea23c74ce4269f235250deee71e1544729201de932e
|
|
| MD5 |
8908278452806ac58db49d3eaa84d173
|
|
| BLAKE2b-256 |
8af8eefe1b3f5776d2aed0f25c9b4b90f779854cf4c38199aa130482ed23a094
|
File details
Details for the file langdb_adk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: langdb_adk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76b884a1aa3d7c0ab455c76f81f5763db5d300a27e28ca6ec27ad6a51899c369
|
|
| MD5 |
8139bf2e01c3b1269902dd42629229a4
|
|
| BLAKE2b-256 |
db31f37d977fef926a24154dbcf53a1907d22855f7955c856af4fae9853741fa
|