Context.ai
  • What is Context.ai?
  • List of Trackable Metrics
  • Product Analytics
    • Overview
    • Topic Categorisation
      • LLM Topics
    • User Engagement Tracking
    • Foreign Language Support
    • PII Filtering
    • Custom Metadata Filtering
    • Backfill Analytics Data
    • Custom Events
    • API Ingestion Methods
      • Log Conversation
      • [deprecated] Upsert Conversation
      • Thread Conversation
      • Patch Thread Message
      • API Resources
        • Chat Message
        • [deprecated] Tool Message
        • Custom Event
        • Metadata
        • Conversation
        • Thread
    • Embedded API
      • Multi-Tenancy
      • Conversations
        • Series Data
  • Integrations
    • Getting Started
    • Python SDK
    • Javascript SDK
    • LangChain Plugin
    • Haystack Plugin
    • Authorization
Powered by GitBook
On this page
  • Log a Conversation
  • Example Request
  • Example Response

Was this helpful?

  1. Product Analytics
  2. API Ingestion Methods

Log Conversation

The "Log Conversation" API allows you to submit LLM transcripts for ingestion by Context.ai.

Log a Conversation

POST https://api.context.ai/api/v1/log/conversation

Records a conversation in Context.

Request Body

Name
Type
Description

conversation*

Object

{ "status": "ok" }

Example Request

{
  "conversation": {
    "messages": [
      {
        "role": "system",
        "message": "You are a LLM providing information about a local football club.",
        "event_timestamp": "2020-02-20T20:20:23Z"
      },
      {
        "role": "user",
        "message": "What time does the team arrive?",
        "event_timestamp": "2020-02-20T20:21:34Z"
      },
      {
        "role": "assistant",
        "message": "I'm not sure what time the team arrives.",
        "event_timestamp": "2020-02-20T23:20:40Z",
        "rating": -1
      }
    ],
    "metadata": {
      "model": "gpt-3.5-turbo-16k",
      "user_id": "2947451"
    }
  }
}

Example Response

{ "status": "ok" }
PreviousAPI Ingestion MethodsNext[deprecated] Upsert Conversation

Last updated 1 year ago

Was this helpful?

A object.

Conversation