Authentication
Set yourDEEPSEEK_API_KEY environment variable. Get your key from here.
Example
UseDeepSeek with your Agent:
Params
DeepSeek 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.
DEEPSEEK_API_KEY environment variable. Get your key from here.
export DEEPSEEK_API_KEY=***
setx DEEPSEEK_API_KEY ***
DeepSeek with your Agent:
from phi.agent import Agent, RunResponse
from phi.model.deepseek import DeepSeekChat
agent = Agent(model=DeepSeekChat(), markdown=True)
# Get the response in a variable
# run: RunResponse = agent.run("Share a 2 sentence horror story.")
# print(run.content)
# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "deepseek-chat" | The specific model ID used for generating responses. |
name | str | "DeepSeekChat" | The name identifier for the DeepSeek model. |
provider | str | "DeepSeek" | The provider of the model. |
api_key | Optional[str] | - | The API key used for authenticating requests to the DeepSeek service. Retrieved from the environment variable DEEPSEEK_API_KEY. |
base_url | str | "https://api.deepseek.com" | The base URL for making API requests to the DeepSeek service. |
Was this page helpful?