Skip to main content

Agent API overview

Agent APIs configure a model, instructions, tools, and optional runtime controls, then execute a prompt and return an AgentResult or JSON payload. Signatures and option builders differ by language; see the SDK references for complete package details.

import asyncio
from ish import Agent


async def main() -> None:
agent = Agent(
name="assistant",
model="gpt-4o-mini",
instructions="Answer clearly and briefly.",
max_turns=8,
)
try:
result = await agent.run("Summarize the request.")
print(result.content)
finally:
agent.close()


asyncio.run(main())

Configure an agent​

The examples above show the minimum inputs: a model, agent instructions, and a user prompt. Configure the provider credentials required by the selected model before starting a run. Add tools and runtime options only when the application needs them.

Tools, options​

Tools are callable capabilities exposed to the model. Their descriptions and input schemas are sent with model requests, and tool outputs are returned to the execution loop. See Tools for Python's @tool decorator, Rust's ToolBackend, and JSON Schema descriptors across TypeScript, Go, C#, and Java.

Additional options may configure context, subagents, skills, budgets, permissions, persistence, lifecycle hooks, and streaming. Consult each SDK's README and types for exact option names, defaults, and behavior, and see SDK conformance for cross-language coverage.

Reusable agent setup​

Reusable Agent wrappers are available in every SDK, including C# and Java. The five host-language SDKs also expose a typed RemoteAgent helper for invoking an ISH HTTP endpoint; Rust callers can invoke the shared remote_agent.run operation directly.