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
CompletionService
andChatService
; introducedAgentService
to expand chat with tools (function calls). - Introduced
ChatMessage
as a multipart message that supports agents (files, tool calls, etc.).ChatMessage.role
has been renamed to "author" with onlyUSER
andBOT
as values; other OpenAI specific values have been moved intoOpenAiAgentMessage
.OpenAiChatMessage
is translated transparently back and forth insideOpenAiChatService
.OpenAiChatService
now usesChatMessage
andChatCompletion
in its interface, to abstract over OpenAI API.OpenAiChatCompletion
is no longer needed and has been removed;ChatCompletion
API is backward compatible. Tool
,ToolCall
, andToolCallResult
are now classes to support multipartChatMessage
s. Corresponding OpenAI implementations have been renamed toOpenAITool
and,OpenAIToolCall
,:OpenAIToolCallResult
is no longer needed and has been deleted.- Introduced
Capability
which 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 ofAgents
who have capabilities, regardless the underlying services. OpenAiChatMessage
is 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
Tokenizer
so 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).
OpenAiEmbeddingService
now usestext-embedding-3-small
by 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
OpenAiModelService
following the decommissioning of several OpenAI models. OpenAiCompletionService
usesdavinci-002
as 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
edits
API as it is no longer available. - New OpenAI models added as for 2024, Jan. 25th announcement.
- Improvements & bug fixes.