0xReisearch
  • //Welcome
  • //notions
    • Intro
  • //Core
    • Evolution
  • Catalog
    • //hanabi-1
  • //Factory & Core API/SDK (Cross-Framework)
    • Reigent Factory
      • Factory V 0.4.0 Overview
    • How to get your API key
    • API reference
      • GET Reigent
      • Chat Completion
    • ReiCore SDK
      • Integration with Existing Agents
      • Integration with Existing Services
    • Additional Capability (Provided & Custom)
      • DeFi (Current Level : 1)
      • Research
      • Custom Tools
  • Tokenomics
  • API/SDK v0.5 Model - A Base Layer For all Agents
  • /legacy
Powered by GitBook
On this page
  1. //Factory & Core API/SDK (Cross-Framework)
  2. API reference

Chat Completion

Following the standard set by OpenAI we're in the process of migrating from Chat Completion to Response.

Chat completion by Reigent.

  • URL: /rei/agents/chat-completion

  • Method: POST

  • Headers:

    Key
    Value

    Authorization

    Bearer rei-agent-secret-token

  • Request:

{
    "messages": [
        {
            "role": "user",
            "content": "Hello, can you help me with my research?"
        }
    ],
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "description": "Get current temperature of given location",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "City and country (e.g. Paris, France)"
                        }
                    },
                    "required": ["location"],
                    "additionalProperties": false
                },
                "strict": true
            }
        }
    ]
};
  • Response:

without tools

{
  "choices": [
    {
      "index": 0,
      "message": {
        "content": "Hello! How can I assist you today?",
        "role": "assistant"
      }
    }
  ]
}

with tools

{
  "choices": [
    {
      "index": 0,
      "message": {
        "content": "",
        "role": "assistant",
        "tool_calls": [
          {
            "id": "call_zSIBPi4QKxjkpAewfi5YbTnI",
            "type": "function",
            "function": {
              "name": "get_weather",
              "arguments": "{\"location\":\"Paris, France\"}"
            }
          }
        ]
      }
    }
  ]
}
  • Error

Response Code
Reason

401

Unauthorized

404

Agent not found

PreviousGET ReigentNextReiCore SDK

Last updated 1 month ago