Skip to main content

Actions

Actions are the core functionality to interact with AI models.

Inference

The inference action allows you to generate responses from AI models.

Parameters

  • model (string, required): Name of the model to use
  • context (object, required): The context object containing:
    • messages (array): Array of message objects
    • temperature (number, optional): Sampling temperature, defaults to 1.0
    • max_tokens (number, optional): Maximum tokens to generate

Returns

  • response (object):
    • text (string): Generated response text
    • usage (object): Token usage statistics
    • model (string): Model used for inference

Example

POST /api/inference
Headers:
X-Vuedoo-Domain: your-domain
X-Vuedoo-Access-Key: your-access-key
{
"model": "gpt-3.5-turbo",
"context": {
"messages": [
{"role": "user", "content": "Hello"}
],
"temperature": 0.7
}
}