Skip to content

Feature: Add Conversations API support - #369

Open
tirthoguha wants to merge 1 commit into
sashirestela:mainfrom
tirthoguha:feat/conversations-api
Open

Feature: Add Conversations API support#369
tirthoguha wants to merge 1 commit into
sashirestela:mainfrom
tirthoguha:feat/conversations-api

Conversation

@tirthoguha

Copy link
Copy Markdown

Summary

Implements OpenAI's Conversations API, server-managed conversation state as an alternative to manual previousResponseId chaining.

Addresses #357 and per discussion in #359.

Changes

  • Add Conversations and ConversationItems endpoints per OpenAI API spec
  • Add conversation parameter to ResponseRequest/Response for server-managed state
  • Add PRIORITY to ServiceTier enum (fixes deserialization with priority tier)
  • Add domain objects: Conversation, ConversationRequest, ConversationModifyRequest, ConversationItemsRequest
  • Add ConversationV4Demo showing Conversation API pattern
  • Add comprehensive unit tests with JSON fixtures (9 tests, all passing)

Testing

  • ✅ All tests pass: mvn test -Dtest=ConversationDomainTest
  • ✅ Formatting verified: mvn spotless:check
  • ✅ Demo tested with live API

Notes

  • Maintains backward compatibility - previousResponseId still works
  • Conversation parameter provides server-managed state similar to Threads API for Assistants
  • Items in conversations must be manually deleted (not auto-deleted with conversation)

References

- Add Conversations and ConversationItems endpoints per OpenAI API spec
- Add conversation parameter to ResponseRequest/Response for server-managed state
- Add PRIORITY to ServiceTier enum (fixes deserialization error with priority tier)
- Implement domain objects: Conversation, ConversationRequest, ConversationModifyRequest, ConversationItemsRequest
- Add ConversationV4Demo showing server-managed conversation vs manual previousResponseId chaining
- Add comprehensive unit tests with JSON fixtures (9 tests, all passing)
- Fix conversation items cleanup in demo (items not auto-deleted with conversation)

Resolves need for durable conversation state management similar to Threads API for Assistants.
@sonarqubecloud

Copy link
Copy Markdown

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