v1

latestOpenAPI 3.0.2Apache-2.02026-07-142963051.0 MB
AI

Generate text

Sends an AI request to supported Large Language Models (LLMs) and returns generated text based on the provided prompt.

post/ai/text_gen

Request body

promptstring required

The prompt provided by the client to be answered by the LLM. The prompt's length is limited to 10000 characters.

Example request

{
  "prompt": "Write an email to a client about the importance of public APIs.",
  "items": [
    {
      "id": "123",
      "type": "file",
      "content": "This is file content that is relevant to the text gen request."
    }
  ],
  "dialogue_history": [
    {
      "prompt": "Make my email about public APIs sound more professional.",
      "answer": "Here is the first draft of your professional email about public APIs.",
      "created_at": "2012-12-12T10:53:43-08:00"
    }
  ],
  "ai_agent": {
    "type": "ai_agent_id",
    "id": "14031"
  }
}

Response

A successful response including the answer from the LLM.

answerstring required

The answer provided by the LLM.

created_atstring date-time required

The ISO date formatted timestamp of when the answer to the prompt was created.

completion_reasonstring

The reason the response finishes.

Example response

{
  "answer": "Public APIs are important because of key and important reasons.",
  "created_at": "2012-12-12T10:53:43-08:00",
  "completion_reason": "done",
  "ai_agent_info": {
    "models": [
      {
        "name": "azure__openai__text_embedding_ada_002",
        "provider": "azure",
        "supported_purpose": "embedding"
      }
    ],
    "processor": "basic_text"
  }
}