Questions about Assistant, threads

Hello Lukas,

Welcome to our community! It’s great to see new developers diving into the Assistant API. I’ll address your questions in a more informal and clear manner:

Context Maintenance in Threads:

Horizontal Scalability with Assistants and Threads:

  • You’re on the right track by creating a unique assistant and thread for each user (OpenAI Platform) . Each thread acts as an independent conversation and can handle a unique user ( API Reference - OpenAI API) . There are rate limits and potential pricing considerations based on usage volume, but planning ahead can help manage them effectively.

Cleaning or Emptying Threads:

  • It seems, based on the official documentation and API references for OpenAI Assistants, that you can edit or modify threads, but currently, the only available parameter for modification is the metadata. API Reference - OpenAI API - Modify Thread

image
API Reference - OpenAI API - Threads

Instead, you can effectively manage the continuity of the conversation by creating new threads when you need a fresh start or ensuring relevant content continues in future interactions.

sequenceDiagram
    autonumber
    participant User as User
    participant API as Assistants API
    participant Thread as Thread (Conversation)
    participant Message as Message

    User->>API: Create Thread (POST /v1/threads)
    API->>Thread: Thread Initialized
    Thread->>User: Respond with Thread ID

    User->>API: Send Message (POST /v1/threads/{thread_id}/messages)
    API->>Message: Process Message
    Message->>Thread: Add Message to Thread
    Thread->>User: Confirm Message Receipt

    User->>API: Request Response (GET /v1/threads/{thread_id}/messages)
    API->>Thread: Retrieve Last Message
    Thread->>API: Provide Last Message
    API->>User: Display Assistant's Response

I hope this helps shed some light on your questions!

More:

14 Likes