ayn.actions¶
Custom actions for ChatGPT and Claude.
Functions
|
Generate ChatGPT custom action configuration |
|
Generate Claude Desktop MCP configuration |
- ayn.actions.generate_chatgpt_action(controller, metadata, api_url)[source]¶
Generate ChatGPT custom action configuration
- Parameters:
controller (
AgentController) – Agent controllermetadata (
AgentMetadata) – Agent metadataapi_url (
str) – Base URL for the API
- Return type:
- Returns:
ChatGPT action configuration
Example
>>> from ayn.controllers import GenericController >>> from ayn.core import AgentMetadata, AgentFramework, ControllerConfig >>> meta = AgentMetadata(name="test", description="test", framework=AgentFramework.CUSTOM) >>> controller = GenericController(meta, ControllerConfig()) >>> action = generate_chatgpt_action(controller, meta, "https://api.example.com") >>> action['schema']['info']['title'] 'test'
- ayn.actions.generate_claude_mcp_config(mcp_server, server_url, transport='sse')[source]¶
Generate Claude Desktop MCP configuration
- Parameters:
- Return type:
- Returns:
Claude Desktop MCP config
Example
>>> from ayn.mcp import MCPServer >>> server = MCPServer("test") >>> config = generate_claude_mcp_config(server, "http://localhost:8000") >>> config['mcpServers']['test']['url'] 'http://localhost:8000/sse'
Modules