A11 TypeScript API - v0.2.1
    Preparing search index...

    Function makeTextMessageInteraction

    • Build an interaction carrying a single text message.

      The content is the backend-neutral {role, content: [text part]} envelope, so a plain text turn stays portable across a mid-conversation model switch.

      Parameters

      • text: string
      • systemPrompt: string = ''
      • role: Role = Role.USER

      Returns StatusOr<
          {
              action_calls: unknown[];
              action_configs: Record<string, unknown>;
              action_inputs: Record<string, unknown[]>;
              action_outputs: Record<string, unknown[]>;
              backend_specific_metadata: Record<string, string>;
              content: unknown[];
              created_at_millis?: number | null;
              id: string;
              model: string;
              previous_interaction_id: string;
              role: "user" | "system" | "model";
              status?: unknown;
              system_instructions: unknown[];
              usage_metadata?:
                  | {
                      cache_write_tokens?: number
                      | null;
                      cached_input_tokens?: number | null;
                      input_tokens?: number | null;
                      output_tokens?: number | null;
                      reasoning_tokens?: number | null;
                      total_tokens?: number | null;
                      [key: string]: unknown;
                  }
                  | null;
              [key: string]: unknown;
          },
      >