POST
/
v4
/
agents
/
execute
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const executeAgentResponse = await client.agents.execute({
    messages: [{ content: 'string' }],
    model: 'gpt-4',
    tools: [{ arguments: { type: 'object' }, description: 'description', name: 'name' }],
  });

  console.log(executeAgentResponse.action);
}

main();
{
  "action": "tool_request",
  "context": {
    "content": "<string>",
    "tool_request": {
      "name": "<string>",
      "arguments": "<string>"
    }
  }
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.