Example Usage
import { GenerationContentData } from "@openrouter/sdk/models";
let value: GenerationContentData = {
error: null,
input: {
messages: [
{
"content": "What is the meaning of life?",
"role": "user",
},
],
},
output: {
completion: "The meaning of life is a philosophical question...",
reasoning: null,
},
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
error | models.GenerationContentError | :heavy_check_mark: | The stored failure for this generation, or null when it succeeded | { “message”: “Timed out waiting for the provider”, “previous_errors”: [ { “code”: 429, “message”: “Provider returned error”, “provider_name”: “Google”, “raw”: ”{“error”:{“code”:429,“message”:“Resource exhausted”}}” } ], “provider_name”: “Vertex”, “raw”: ”{“error”:{“code”:504,“message”:“Deadline exceeded”}}”, “status”: 504 } |
input | models.InputUnion | :heavy_check_mark: | The input to the generation — either a prompt string or an array of messages | |
output | models.GenerationContentDataOutput | :heavy_check_mark: | The output from the generation |