Authentication
Set yourFIREWORKS_API_KEY environment variable. Get your key from here.
Example
UseFireworks with your Agent:
Params
Fireworks 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.
FIREWORKS_API_KEY environment variable. Get your key from here.
export FIREWORKS_API_KEY=***
setx FIREWORKS_API_KEY ***
Fireworks with your Agent:
from phi.agent import Agent, RunResponse
from phi.model.fireworks import Fireworks
agent = Agent(
model=Fireworks(id="accounts/fireworks/models/firefunction-v2"),
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 | "accounts/fireworks/models/firefunction-v2" | The specific model ID used for generating responses. |
name | str | "Fireworks: {id}" | The name identifier for the agent. Defaults to "Fireworks: " followed by the model ID. |
provider | str | "Fireworks" | The provider of the model. |
api_key | Optional[str] | - | The API key for authenticating requests to the service. Retrieved from the environment variable FIREWORKS_API_KEY. |
base_url | str | "https://api.fireworks.ai/inference/v1" | The base URL for making API requests to the Fireworks service. |
Was this page helpful?