Authentication
Set yourLANGDB_API_KEY environment variable. Get your key from here.
Example
UseLangDB with your Agent:
Params
LangDB also supports the params of OpenAI.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
LANGDB_API_KEY environment variable. Get your key from here.
export LANGDB_API_KEY=***
export LANGDB_PROJECT_ID=***
setx LANGDB_API_KEY ***
setx LANGDB_PROJECT_ID ***
LangDB with your Agent:
from agno.agent import Agent, RunResponse
from agno.models.langdb import LangDB
agent = Agent(
model=LangDB(id="gpt-4o"),
markdown=True
)
# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "gpt-4o" | The model ID used for generating responses. |
name | str | "LangDB" | The name identifier for the LangDB agent. |
provider | str | "LangDB:" + id | The provider of the model, combining "LangDB" with the model ID. |
api_key | Optional[str] | getenv("LANGDB_API_KEY") | The API key for authenticating requests to LangDB, retrieved from the LANGDB_API_KEY environment variable. |
project_id | Optional[str] | getenv("LANGDB_PROJECT_ID") | The project ID for LangDB, retrieved from the LANGDB_PROJECT_ID environment variable. If not set, a warning is logged. |
base_url | str | "https://api.us-east-1.langdb.ai/{project_id}/v1" | The base URL for making API requests to LangDB. The {project_id} is dynamically included. |
default_headers | Optional[dict] | None | Optional custom headers for API requests. |
LangDB also supports the params of OpenAI.Was this page helpful?