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

feat(conversations): add conversation and model management APIs #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tharropoulos
Copy link
Contributor

Rationale

This PR introduces conversation management capabilities to the Typesense Java client, allowing developers to integrate LLM-powered conversations into their applications.

This addition enables Java developers to:

  • Configure and manage LLM models through Typesense
  • Store and retrieve conversation histories
  • Set up model-specific parameters like context windows and system prompts
  • Integrate with OpenAI and other LLM providers

Changes

Added Features

  1. New Classes for Conversation Management:

    • ConversationModel: Handles individual model operations (CRUD)
    • ConversationModels: Manages model collections
    • Conversation: Manages individual conversations
    • Conversations: Handles conversation collections
  2. New Schema Classes:

    • ConversationSchema: Defines conversation structure
    • ConversationModelCreateSchema: Model creation parameters
    • ConversationModelUpdateSchema: Model update parameters
    • ConversationDeleteSchema: Deletion response structure

Code Changes

  1. In Client.java:

    • Added conversation management support
    • Implemented new methods: conversations() and conversations(String id)
    • Added conversation-related fields and initialization
  2. In Helper.java:

    • Added createConversationCollection() for test setup
    • Added createTestConversationModel() for testing
    • Updated teardown() to clean up conversation resources
  3. In build.gradle:

    • Fixed JUnit platform configuration for CI environment

Test Updates

  1. Added ConversationModelsTest.java:
    • Test coverage for model CRUD operations
    • Integration tests with OpenAI GPT-3.5
    • Environment variable handling for API keys

PR Checklist

- Add ConversationModels API for managing LLM model configurations
- Add Conversations API for handling chat history and interactions
- Implement CRUD operations for conversation models
- Add integration tests for conversation model operations
- Update Client class to support conversation operations
- Use environment variables for OpenAI API key in tests

build(gradle): fix JUnit platform tags configuration
feat(client): add conversation support to base Client class
feat(schema): add conversation data model interfaces
feat(api): implement conversation model management
feat(api): add conversation history management
test(conversations): add integration tests for model operations
feat(test-utils): add conversation collection and model setup
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.

1 participant