Agent Inference
DigitalOcean Gradient™ AI Agentic Cloud allows you to create multi-agent workflows to power your AI applications. This allows developers to integrate agents into your AI applications.
Endpoint Access Keys
Section titled “Endpoint Access Keys”You can create an agent endpoint access key in the settings of your agent in the console.
Examples
Section titled “Examples”Sync Client
Section titled “Sync Client”For example, you can access agent inference using the SDK:
import osfrom gradient import Gradient
agent_client = Gradient( agent_access_key=os.environ.get("GRADIENT_AGENT_ACCESS_KEY"), # default agent_endpoint=os.environ.get("GRADIENT_AGENT_ENDPOINT"), # default)
agent_response = agent_client.agents.chat.completions.create( messages=[ { "role": "user", "content": "What is the capital of Portugal?", } ], model="ignored",)
print(agent_response.choices[0].message.content)
Async Client
Section titled “Async Client”The async client uses the exact same interface.
import osfrom gradient import AsyncGradient
agent_client = AsyncGradient( agent_access_key=os.environ.get("GRADIENT_AGENT_ACCESS_KEY"), # default agent_endpoint=os.environ.get("GRADIENT_AGENT_ENDPOINT"), # default)
agent_response = await agent_client.agents.chat.completions.create( messages=[ { "role": "user", "content": "What is the capital of Portugal?", } ], model="ignored",)
print(agent_response.choices[0].message.content)