This release features a major rework due to introduction of "Agents" which are able to interact with users over a conversation, including multi-media support and tools (function calls). Agents provide an abstraction over actual API used (chat or assistants) and tools (single or parallel function calls).
In addition, this release adds support for several new features and models in OpenAI.
- Reworked hierarchy of
CompletionServiceandChatService; introducedAgentServiceto expand chat with tools (function calls). - Introduced
ChatMessageas a multipart message that supports agents (files, tool calls, etc.).ChatMessage.rolehas been renamed to "author" with onlyUSERandBOTas values; other OpenAI specific values have been moved intoOpenAiAgentMessage.OpenAiChatMessageis translated transparently back and forth insideOpenAiChatService.OpenAiChatServicenow usesChatMessageandChatCompletionin its interface, to abstract over OpenAI API.OpenAiChatCompletionis no longer needed and has been removed;ChatCompletionAPI is backward compatible. Tool,ToolCall, andToolCallResultare now classes to support multipartChatMessages. Corresponding OpenAI implementations have been renamed toOpenAITooland,OpenAIToolCall,:OpenAIToolCallResultis no longer needed and has been deleted.- Introduced
Capabilitywhich is a grouping of tools working together to provide agents with skills. The library has been reworked to support this at an abstract level, allowing the creation ofAgentswho have capabilities, regardless the underlying services. OpenAiChatMessageis now multi-part too, to support vision models.- Services now extend
AutoCloseable. - Reworked all POJO for API calls so their Lombok annotations are aligned and they have a standardized set of constructors.
- Interfaces using generics now use
<? extends T>instead of<T>where appropriate. - Reworked
Tokenizerso that now it returns exact token counts for OpenAI models and it is faster. Token calculation in various services has been adjusted to benefit from this new feature. - Added support for new OpenAI embeddings API (new models and embedding size parameter).
OpenAiEmbeddingServicenow usestext-embedding-3-smallby default. - Transcription of audio files (STT) in OpenAI now supports all output formats defined in the audio API endpoint.
- Chat completions API now supports generating logprobs.
- Support for reproducible outputs in chat completions API.
- Updated
OpenAiModelServicefollowing the decommissioning of several OpenAI models. OpenAiCompletionServiceusesdavinci-002as default model. This service is now a legacy.- New fine tuning API implemented (
/v1/fine_tuning/jobs), old decommissioned fine-tune API removed. - API clients now handle HTTP 504 error automatically as well.
- Removed OpenAI
editsAPI as it is no longer available. - New OpenAI models added as for 2024, Jan. 25th announcement.
- Improvements & bug fixes.