Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use collections to store conversations #1723

Merged
merged 6 commits into from
May 14, 2024

Conversation

ozanarmagan
Copy link
Contributor

@ozanarmagan ozanarmagan commented May 10, 2024

Use collection to store conversations

To use a collection to store conversations, first create a collection with given schema:

{
    "name": "conversation_store",
    "fields": [
        {
            "name": "conversation_id",
            "type": "string",
            "facet": true
        },
        {
            "name": "role",
            "type": "string"
        },
        {
            "name": "message",
            "type": "string"
        },
        {
            "name": "timestamp",
            "type": "int32",
            "sort": true
        }
    ]
}

Set conversation history collection for conversation model

curl 'http://localhost:8108/conversations/models' \
  -X POST \
  -H 'Content-Type: application/json' \
  -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
  -d '{
        "model_name": "openai/gpt-3.5-turbo",
        "api_key": "OPENAI_API_KEY",
        "system_prompt": "You are an assistant for question-answering. You can only make conversations based on the provided context. If a response cannot be formed strictly using the provided context, politely say you don’t have knowledge about that topic."
        "max_bytes": 16384,
        "conversation_history": "conversation_store"
      }'

@kishorenc kishorenc merged commit 1b4e08b into typesense:v0.26-facets May 14, 2024
1 check passed
kishorenc pushed a commit that referenced this pull request May 21, 2024
* Use collections to store conversations

* Use conversation model to select conversation history collections

* Fix multi search add conversation call

* Add support for migrating conversation models

* use same suffix for all default conversation collections

* delete `delete_models_With_conversation_collection`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants