# Functions ## Create `agents.functions.create(strpath_agent_uuid, FunctionCreateParams**kwargs) -> FunctionCreateResponse` **post** `/v2/gen-ai/agents/{agent_uuid}/functions` To create a function route for an agent, send a POST request to `/v2/gen-ai/agents/{agent_uuid}/functions`. ### Parameters - **agent\_uuid:** `str` - **agent\_uuid:** `str` - **description:** `str` Function description - **faas\_name:** `str` The name of the function in the DigitalOcean functions platform - **faas\_namespace:** `str` The namespace of the function in the DigitalOcean functions platform - **function\_name:** `str` Function name - **input\_schema:** `object` Describe the input schema for the function so the agent may call it - **output\_schema:** `object` Describe the output schema for the function so the agent handle its response ### Returns - `class FunctionCreateResponse` Information about a newly function linked agent - **agent:** `Optional[APIAgent]` An Agent ### Example ```python from gradient import Gradient client = Gradient() function = client.agents.functions.create( path_agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", ) print(function.agent) ``` ## Update `agents.functions.update(strpath_function_uuid, FunctionUpdateParams**kwargs) -> FunctionUpdateResponse` **put** `/v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}` To update the function route, send a PUT request to `/v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}`. ### Parameters - **agent\_uuid:** `str` - **function\_uuid:** `str` - **agent\_uuid:** `str` - **description:** `str` Funciton description - **faas\_name:** `str` The name of the function in the DigitalOcean functions platform - **faas\_namespace:** `str` The namespace of the function in the DigitalOcean functions platform - **function\_name:** `str` Function name - **function\_uuid:** `str` - **input\_schema:** `object` Describe the input schema for the function so the agent may call it - **output\_schema:** `object` Describe the output schema for the function so the agent handle its response ### Returns - `class FunctionUpdateResponse` The updated agent - **agent:** `Optional[APIAgent]` An Agent ### Example ```python from gradient import Gradient client = Gradient() function = client.agents.functions.update( path_function_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", path_agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", ) print(function.agent) ``` ## Delete `agents.functions.delete(strfunction_uuid, FunctionDeleteParams**kwargs) -> FunctionDeleteResponse` **delete** `/v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}` To delete a function route from an agent, send a DELETE request to `/v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}`. ### Parameters - **agent\_uuid:** `str` - **function\_uuid:** `str` ### Returns - `class FunctionDeleteResponse` Information about a newly unlinked agent - **agent:** `Optional[APIAgent]` An Agent ### Example ```python from gradient import Gradient client = Gradient() function = client.agents.functions.delete( function_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", ) print(function.agent) ```