Skip to main content

TextContent

Plain text content for messages in LLM conversations.

Import

import type { TextContent } from '@adaline/api';

Type Definition

interface TextContent {
  modality: 'text';
  value: string;
}

Fields

modality
string
required
Must be "text".
value
string
required
The text content string.

Example

import type { TextContent, PromptMessage } from '@adaline/api';

const text: TextContent = {
  modality: 'text',
  value: 'Hello, how are you?'
};

const message: PromptMessage = {
  role: 'user',
  content: [text]
};
JSON:
{
  "modality": "text",
  "value": "Hello, how are you?"
}