ayn.actions.chatgpt¶
ChatGPT custom action generation.
Functions
|
Generate ChatGPT custom action configuration |
- ayn.actions.chatgpt.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'