Skip to main content

Viewing Threads

To view Threads, head to the Traces section and select the Threads tab.
By selecting a Thread, you can then visualize the conversation.

Adding a Deployment Generation to a Thread

Threads are configured at runtime when using the Invoke API. The API receives the following extra parameter:
Conversations will be grouped by Thread ID Tags can be used to filter and search Threads in the panel.
{
  "thread": { 
   	"id": "<unique-thread-id>",
    "tags": ["tag1", "tag2"]
  }
}
Using the previously mentioned payload, the invoke call looks as follow:
import os

from orq_ai_sdk import Orq

client = Orq(
  api_key=os.environ.get("ORQ_API_KEY", "<insert your api key here>"),
  environment="production",
)

generation = client.deployments.invoke(
  key="deployment-demo",
  context={
    "environments": []
  },
  metadata={
    "custom-field-name": "custom-metadata-value"
  },
  thread={
    "id": "<insert unique thread id here>", 
    "tags": ["tag1", "tag2"]
  }
)

print(generation.choices[0].message.content)