mirror of https://github.com/aliasrobotics/cai.git
Merge branch 'docs_new' of https://gitlab.com/aliasrobotics/alias_research/cai into docs_new
This commit is contained in:
commit
904ea8171d
|
|
@ -51,7 +51,7 @@ nav:
|
||||||
# - voice/tracing.md
|
# - voice/tracing.md
|
||||||
- API Reference:
|
- API Reference:
|
||||||
- Agents:
|
- Agents:
|
||||||
- ref/index.md
|
#- ref/index.md
|
||||||
- ref/agent.md
|
- ref/agent.md
|
||||||
- ref/run.md
|
- ref/run.md
|
||||||
- ref/tool.md
|
- ref/tool.md
|
||||||
|
|
@ -70,8 +70,8 @@ nav:
|
||||||
- ref/models/interface.md
|
- ref/models/interface.md
|
||||||
- ref/models/openai_chatcompletions.md
|
- ref/models/openai_chatcompletions.md
|
||||||
- ref/models/openai_responses.md
|
- ref/models/openai_responses.md
|
||||||
- ref/mcp/server.md
|
# - ref/mcp/server.md
|
||||||
- ref/mcp/util.md
|
# - ref/mcp/util.md
|
||||||
# - Tracing:
|
# - Tracing:
|
||||||
# - ref/tracing/index.md
|
# - ref/tracing/index.md
|
||||||
# - ref/tracing/create.md
|
# - ref/tracing/create.md
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
|
|
||||||
class AgentsException(Exception):
|
class AgentsException(Exception):
|
||||||
"""Base class for all exceptions in the Agents SDK."""
|
"""Base class for all exceptions in the CAI Agents."""
|
||||||
|
|
||||||
|
|
||||||
class MaxTurnsExceeded(AgentsException):
|
class MaxTurnsExceeded(AgentsException):
|
||||||
|
|
@ -29,7 +29,7 @@ class ModelBehaviorError(AgentsException):
|
||||||
|
|
||||||
|
|
||||||
class UserError(AgentsException):
|
class UserError(AgentsException):
|
||||||
"""Exception raised when the user makes an error using the SDK."""
|
"""Exception raised when the user makes an error using CAI."""
|
||||||
|
|
||||||
message: str
|
message: str
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,16 +30,16 @@ if TYPE_CHECKING:
|
||||||
from .agent import Agent
|
from .agent import Agent
|
||||||
|
|
||||||
TResponse = Response
|
TResponse = Response
|
||||||
"""A type alias for the Response type from the OpenAI SDK."""
|
"""A type alias for the Response type."""
|
||||||
|
|
||||||
TResponseInputItem = ResponseInputItemParam
|
TResponseInputItem = ResponseInputItemParam
|
||||||
"""A type alias for the ResponseInputItemParam type from the OpenAI SDK."""
|
"""A type alias for the ResponseInputItemParam type."""
|
||||||
|
|
||||||
TResponseOutputItem = ResponseOutputItem
|
TResponseOutputItem = ResponseOutputItem
|
||||||
"""A type alias for the ResponseOutputItem type from the OpenAI SDK."""
|
"""A type alias for the ResponseOutputItem type."""
|
||||||
|
|
||||||
TResponseStreamEvent = ResponseStreamEvent
|
TResponseStreamEvent = ResponseStreamEvent
|
||||||
"""A type alias for the ResponseStreamEvent type from the OpenAI SDK."""
|
"""A type alias for the ResponseStreamEvent type."""
|
||||||
|
|
||||||
T = TypeVar("T", bound=Union[TResponseOutputItem, TResponseInputItem])
|
T = TypeVar("T", bound=Union[TResponseOutputItem, TResponseInputItem])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
|
|
||||||
class MCPUtil:
|
class MCPUtil:
|
||||||
"""Set of utilities for interop between MCP and Agents SDK tools."""
|
"""Set of utilities for interop between MCP and CAI tools."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def get_all_function_tools(cls, servers: list["MCPServer"]) -> list[Tool]:
|
async def get_all_function_tools(cls, servers: list["MCPServer"]) -> list[Tool]:
|
||||||
|
|
@ -48,7 +48,7 @@ class MCPUtil:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def to_function_tool(cls, tool: "MCPTool", server: "MCPServer") -> FunctionTool:
|
def to_function_tool(cls, tool: "MCPTool", server: "MCPServer") -> FunctionTool:
|
||||||
"""Convert an MCP tool to an Agents SDK function tool."""
|
"""Convert an MCP tool to an CAI function tool."""
|
||||||
invoke_func = functools.partial(cls.invoke_mcp_tool, server, tool)
|
invoke_func = functools.partial(cls.invoke_mcp_tool, server, tool)
|
||||||
return FunctionTool(
|
return FunctionTool(
|
||||||
name=tool.name,
|
name=tool.name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue