Skip to content

Releases: cequence-io/openai-scala-client

Version 1.1.1

02 Dec 10:59
Compare
Choose a tag to compare

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
  • Fixes:

    • Scala 2.13 JSON schema serialization
  • Refactoring:

    • ChatCompletionBodyMaker (removed WSClient dependency)
    • Removed org.joda.time.DateTime

Version 1.1.0

25 Sep 12:00
Compare
Choose a tag to compare
  • 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

25 Apr 21:20
Compare
Choose a tag to compare

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 with FunctionSpec(s), migrate to createChatToolCompletion using ToolSpec(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 to OpenAIStreamedServiceFactory or OpenAIServiceFactory.withStreaming() (required import: OpenAIStreamedServiceImplicits._)
  • Note that OpenAIServiceStreamedExtra.listFineTuneEventsStreamed has been removed
  • Migrate OpenAIMultiServiceAdapter.ofRoundRobin and ofRandomOrder to adapters.roundRobin and adapters.randomOrder (where adapter is, e.g., OpenAIServiceAdapters.forFullService)
  • Migrate OpenAIRetryServiceAdapter to adapters.retry
  • CreateImageSettings -> CreateImageEditSettings

Version 0.5.0

03 Oct 15:47
Compare
Choose a tag to compare
  • 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 vs training_files (⚠️ Breaking Changes).
    • OpenAIService.createFineTune- settings (CreateFineTuneSettings) adapted - all attributes except n_epochs, model, and suffix dropped: e.g. batch_size, learning_rate_multiplier, prompt_loss_weight (⚠️ Breaking Changes).
    • OpenAIService.listFineTunes - new optional params: after and limit
    • OpenAIService.listFineTuneEvents - new optional params: after and limit
  • Azure service factory functions fixed: forAzureWithApiKey and forAzureWithAccessToken.
  • New models added: gpt-3.5-turbo-instruct (with 0914 snapshot), davinci-002, and babbage-002.
  • Deprecations: OpenAIService.createEdit and OpenAIServiceStreamedExtra.listFineTuneEventsStreamed (not supported anymore).
  • Links to the official OpenAI documentation updated.

Version 0.4.1

18 Jul 19:53
Compare
Choose a tag to compare
  • 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/deprecated OpenAIRetryServiceAdapter 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 replacing mockito-scala-scalatest with scalatestplus mockito.
  • Configuring GitHub CI with crossScalaVersions, newer Java, etc. (thanks @phelps-sg)

Version 0.4.0

15 Jun 17:56
Compare
Choose a tag to compare
  • Function call support for the chat completion with a json output:
    • Function createChatFunCompletion introduced with functions defined by a new data holder FunctionSpec
    • To stay compatible with the standard createChatCompletion function the existing MessageSpec has not been changed
    • Important ⚠️: to harmonize (redundant) response classes, ChatMessage was replaced by the identical MessageSpec class
  • New gpt-3.5-turbo and gpt-4 models for the snapshot 0613 added to ModelId. Old models deprecated.
  • OpenAIService.close method declared with parentheses (thanks @phelps-sg).
  • Scala 2.12 bumped to 2.12.18 and Scala 2.13 to 2.13.11.
  • sbt version bumped to 1.9.0 (thanks @phelps-sg)
  • Command renamed to EndPoint and Tag renamed to Param.
  • OpenAIMultiServiceAdapter - ofRotationType deprecated in favor of a new name ofRoundRobinType
  • OpenAIMultiServiceAdapter - ofRandomAccessType deprecated in favor of ofRandomOrderType.

Version 0.3.3

05 Jun 11:01
Compare
Choose a tag to compare
  • 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

26 Apr 21:00
Compare
Choose a tag to compare
  • 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 and Tag 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

20 Mar 08:45
Compare
Choose a tag to compare
  • 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 in MultipartWritable
  • Removing the obsolete OpenAIService's function - retrieveModelVersions

Version 0.3.0

09 Mar 08:01
Compare
Choose a tag to compare
  • New OpenAIService functions/endpoints: createChatCompletion (ChatGPT API), and audio stuff - createAudioTranscription and createAudioTranslation
  • New OpenAIServiceStreamedExtra function/endpoint: createChatCompletionStreamed
  • New models: whisper-1, gpt-3.5-turbo, and gpt-3.5-turbo-0301
  • DeleteResponse(s) changed from Enumeration to a sealed trait with case classes.
  • Command and Tag enumerations relocated to a separated file + PEP#Value (Command) and PT#Value (Tag/Param) in WSRequestHelper and OpenAIServiceImpl functions simplified/generalized to PEP and PT.