Skip to content

ema-ui / actor/input/route / POST

Variable: POST()

ts
const POST: (req) => Promise<Response>;

Defined in: actor/input/route.ts:52

Sends input to actor.

Body:

  • userId (number): User ID
  • actorId (number): Actor ID
  • conversationId (number): Conversation ID
  • inputs (Content[]): Array of inputs

Content:

  • type ("text"): The content type.
  • text (string): The text content.

Parameters

req

Request

Returns

Promise<Response>

Example

ts
// Send text input to actor
const response = await fetch("/api/actor/input", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    userId: 1,
    actorId: 1,
    conversationId: 1,
    inputs: [{ type: "text", text: "Hello, world!" }],
  }),
});