Releases: cequence-io/openai-scala-client
Releases · cequence-io/openai-scala-client
Version 1.1.1
Sure, here's the proofread version:
-
New Models:
- Claude 3.5 Sonnet / Haiku, Llama 3.2, grok-beta, gpt-4o-2024-11-20, etc.
-
New Providers:
- Grok and Deepseek (with examples)
-
Enhanced Anthropic Integration:
- Message/block caching
- System prompt generalized as a "message"
- PDF block processing
-
Better Support for JSON:
createChatCompletionWithJSON
-
Adapters:
- Failover models support for chat completion (
createChatCompletionWithFailover
) - Core adapters/wrappers abstracted and relocated to
ws-client
- Failover models support for chat completion (
-
Fixes:
- Scala 2.13 JSON schema serialization
-
Refactoring:
ChatCompletionBodyMaker
(removedWSClient
dependency)- Removed
org.joda.time.DateTime
Version 1.1.0
- Support for O1 Models: Introduced special handling for settings and conversion of system messages.
- New Endpoints: Added endpoints for runs, run steps, vector stores, vector store files, and vector store file batches.
- Structured Output: Enhanced output with JSON schema and introduced experimental reflective inference from a case class.
- New Providers: Added support for Google Vertex AI, TogetherAI, Cerebras, and Mistral.
- Fixes: Resolved issues related to fine-tune jobs format, handling of log-probs with special characters, etc.
- Examples/Scenarios: A plethora of new examples!
Lastly, a huge thanks 🙏 to our contributors: @bburdiliak, @branislav-burdiliak, @vega113, and @SunPj!
Version 1.0.0
API Updates
- New functions/endpoints for assistants, threads, messages, and files (thanks @branislav-burdiliak) 🎉
- Fine-tuning API updated (checkpoints, explicit dimensions, etc.)
- Chat completion with images (GPT vision), support for logprobs
- Audio endpoint updates - transcription, translation, speech
- New message hierarchy
- Support for tool calling
- New token count subproject (thanks @branislav-burdiliak , @piotrkuczko)
New Models and Providers
- Improved support for Azure OpenAI services
- Support for Azure AI models
- Support for Groq, Fireworks, OctoAI, Ollama, and FastChat (with examples) 🎉
- New Anthropic client project with OpenAI-compatible chat completion adapter (thanks @branislav-burdiliak) 🎉
- NonOpenAIModelId const object holding the most popular non-openai models introduced (e.g. Llama3-70b, Mixtral-8x22B)
Factories and Adapters
- Full, core, and chat completion factories refactored to support easier and more flexible streaming extension
- Service wrappers refactored and generalized to adapters
- Route adapter allowing the use of several providers (e.g., Groq and Anthropic) alongside OpenAI models for chat-completions 🎉
- Other adapters that have been added include round robin/random order load balancing, logging, retry, chat-to-completion, and settings/messages adapter
Bug Fixes and Improvements
- Fixed null bytes handling in TopLogprobInfo JSON format
- WS request - handling slash at the end of URLs
- Made "data:" prefix handling in
WSStreamRequestHelper
more robust MultipartWritable
- added extension-implied content type for Azure file upload- Fixed chat completion's response_format_type
Examples and Tests
- New example project demonstrating usage of most of the features, providers, and adapters (more than 50)
- Tests for token counts and JSON (de)serialization
Breaking Changes/Migrations:
- Instead of the deprecated
MessageSpec
, use typed{System, User, Assistant, Tool}Message
- Instead of
createChatFunCompletion
withFunctionSpec
(s), migrate tocreateChatToolCompletion
usingToolSpec
(s) - Use a new factory
OpenAIChatCompletionServiceFactory
with a custom URL and auth headers when only chat-completion is supported by a provider - Migrate streaming service creation from
OpenAIServiceStreamedFactory
toOpenAIStreamedServiceFactory
orOpenAIServiceFactory.withStreaming()
(required import:OpenAIStreamedServiceImplicits._
) - Note that
OpenAIServiceStreamedExtra.listFineTuneEventsStreamed
has been removed - Migrate
OpenAIMultiServiceAdapter.ofRoundRobin
andofRandomOrder
toadapters.roundRobin
andadapters.randomOrder
(where adapter is, e.g.,OpenAIServiceAdapters.forFullService
) - Migrate
OpenAIRetryServiceAdapter
toadapters.retry
CreateImageSettings
->CreateImageEditSettings
Version 0.5.0
- Fine-tuning functions/endpoints updated to match the latest API:
- Root URL changed to
/fine_tuning/jobs
. - Fine tune job holder (
FineTuneJob
) adjusted - e.g.finished_at
added,training_file
vstraining_files
(⚠️ Breaking Changes). OpenAIService.createFineTune
- settings (CreateFineTuneSettings
) adapted - all attributes exceptn_epochs
,model
, andsuffix
dropped: e.g.batch_size
,learning_rate_multiplier
,prompt_loss_weight
(⚠️ Breaking Changes).OpenAIService.listFineTunes
- new optional params:after
andlimit
OpenAIService.listFineTuneEvents
- new optional params:after
andlimit
- Root URL changed to
- Azure service factory functions fixed:
forAzureWithApiKey
andforAzureWithAccessToken
. - New models added:
gpt-3.5-turbo-instruct
(with 0914 snapshot),davinci-002
, andbabbage-002
. - Deprecations:
OpenAIService.createEdit
andOpenAIServiceStreamedExtra.listFineTuneEventsStreamed
(not supported anymore). - Links to the official OpenAI documentation updated.
Version 0.4.1
- Retries:
- RetryHelpers trait and retry adapter implementing non-blocking retries introduced (thanks @phelps-sg).
- RetryHelpers - fixing exponential delay, logging, fun(underlying) call, removing unused implicits.
- New exceptions introduced (
OpenAIScalaUnauthorizedException
,OpenAIScalaRateLimitException
, etc) with error handling/catching plus "registering" those that should be automatically retried. ⚠️ Old/deprecatedOpenAIRetryServiceAdapter
removed in favor of a new adapter in the client module (migrate if necessary).
- Support for "OpenAI-API-compatible" providers such as FastChat(Vicuna, Alpaca, LLaMA, Koala, fastchat-t5-3b-v1.0, mpt-7b-chat, etc), Azure, or any other similar service with a custom URL. Explicit factory methods for Azure (with API Key or Access Token) provided.
- Scalafmt and Scalafix configured and applied to the entire source base.
- Fixing test dependencies (e.g.,
akka-actor-testkit-typed
,scala-java8-compat
) and replacingmockito-scala-scalatest
withscalatestplus
mockito
. - Configuring GitHub CI with crossScalaVersions, newer Java, etc. (thanks @phelps-sg)
Version 0.4.0
- Function call support for the chat completion with a json output:
- Function
createChatFunCompletion
introduced with functions defined by a new data holderFunctionSpec
- To stay compatible with the standard
createChatCompletion
function the existingMessageSpec
has not been changed - Important
⚠️ : to harmonize (redundant) response classes,ChatMessage
was replaced by the identicalMessageSpec
class
- Function
- New
gpt-3.5-turbo
andgpt-4
models for the snapshot0613
added toModelId
. Old models deprecated. OpenAIService.close
method declared with parentheses (thanks @phelps-sg).- Scala
2.12
bumped to2.12.18
and Scala2.13
to2.13.11
. - sbt version bumped to
1.9.0
(thanks @phelps-sg) Command
renamed toEndPoint
andTag
renamed toParam
.OpenAIMultiServiceAdapter
-ofRotationType
deprecated in favor of a new nameofRoundRobinType
OpenAIMultiServiceAdapter
-ofRandomAccessType
deprecated in favor ofofRandomOrderType
.
Version 0.3.3
- Scala 3 compatibility refactorings -
JsonFormats
, Scala-Guice lib upgrade, Guice modules, Enums migrations OpenAIService.close
function for the underlying ws client exposed- OpenAI service wrapper with two adapters introduced: 1. Multi-service (load distribution) - rotation or random order, 2. Retry service - custom number of attempts, wait on failure, and logging
Version 0.3.2
- Removing deprecated/unused command/endpoint (
engines
) and settings (ListFineTuneEventsSettings
) - New exception
OpenAIScalaTokenCountExceededException
introduced - thrown for completion or chat completion when the number of tokens needed is higher than allowed - Migrating
Command
andTag
enums to sealed case objects to simplify Scala 3 compilation - Resolving the
scala-java8-compat
eviction problem for Scala 2.13 and Scala 3
Version 0.3.1
- Adding GPT-4 models (with 8k and 32k context)
- Adding an optional display (header) file name to
OpenAIService.uploadFile
function. If not specified a full path is used as a file name instead. - Removing dependence
on play.shaded...HttpHeaderNames
inMultipartWritable
- Removing the obsolete
OpenAIService
's function -retrieveModelVersions
Version 0.3.0
- New
OpenAIService
functions/endpoints:createChatCompletion
(ChatGPT API), and audio stuff -createAudioTranscription
andcreateAudioTranslation
- New
OpenAIServiceStreamedExtra
function/endpoint:createChatCompletionStreamed
- New models:
whisper-1
,gpt-3.5-turbo
, andgpt-3.5-turbo-0301
DeleteResponse
(s) changed from Enumeration to a sealed trait with case classes.Command
andTag
enumerations relocated to a separated file +PEP#Value
(Command
) andPT#Value
(Tag
/Param) inWSRequestHelper
andOpenAIServiceImpl
functions simplified/generalized toPEP
andPT
.