Skip to content

Commit 360fde7

Browse files
committed
README adjusted, prep for a release
1 parent 3b48c22 commit 360fde7

File tree

1 file changed

+28
-19
lines changed

1 file changed

+28
-19
lines changed

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is a no-nonsense async Scala client for OpenAI API supporting all the avail
55

66
* **Models**: [listModels](https://platform.openai.com/docs/api-reference/models/list), and [retrieveModel](https://platform.openai.com/docs/api-reference/models/retrieve)
77
* **Completions**: [createCompletion](https://platform.openai.com/docs/api-reference/completions/create)
8-
* **Chat Completions**: [createChatCompletion](https://platform.openai.com/docs/api-reference/chat/create) (also with JSON schema support 🔥), [createChatFunCompletion](https://platform.openai.com/docs/api-reference/chat/create) (deprecated), and [createChatToolCompletion](https://platform.openai.com/docs/api-reference/chat/create)
8+
* **Chat Completions**: [createChatCompletion](https://platform.openai.com/docs/api-reference/chat/create), [createChatFunCompletion](https://platform.openai.com/docs/api-reference/chat/create) (deprecated), and [createChatToolCompletion](https://platform.openai.com/docs/api-reference/chat/create)
99
* **Edits**: [createEdit](https://platform.openai.com/docs/api-reference/edits/create) (deprecated)
1010
* **Images**: [createImage](https://platform.openai.com/docs/api-reference/images/create), [createImageEdit](https://platform.openai.com/docs/api-reference/images/create-edit), and [createImageVariation](https://platform.openai.com/docs/api-reference/images/create-variation)
1111
* **Embeddings**: [createEmbeddings](https://platform.openai.com/docs/api-reference/embeddings/create)
@@ -17,11 +17,11 @@ This is a no-nonsense async Scala client for OpenAI API supporting all the avail
1717
* **Assistants**: [createAssistant](https://platform.openai.com/docs/api-reference/messages/createMessage), [listAssistants](https://platform.openai.com/docs/api-reference/assistants/listAssistants), [retrieveAssistant](https://platform.openai.com/docs/api-reference/assistants/retrieveAssistant), [modifyAssistant](https://platform.openai.com/docs/api-reference/assistants/modifyAssistant), and [deleteAssistant](https://platform.openai.com/docs/api-reference/assistants/deleteAssistant)
1818
* **Threads**: [createThread](https://platform.openai.com/docs/api-reference/threads/createThread), [retrieveThread](https://platform.openai.com/docs/api-reference/threads/getThread), [modifyThread](https://platform.openai.com/docs/api-reference/threads/modifyThread), and [deleteThread](https://platform.openai.com/docs/api-reference/threads/deleteThread)
1919
* **Thread Messages**: [createThreadMessage](https://platform.openai.com/docs/api-reference/assistants/createAssistant), [retrieveThreadMessage](https://platform.openai.com/docs/api-reference/messages/getMessage), [modifyThreadMessage](https://platform.openai.com/docs/api-reference/messages/modifyMessage), [listThreadMessages](https://platform.openai.com/docs/api-reference/messages/listMessages), [retrieveThreadMessageFile](https://platform.openai.com/docs/api-reference/messages/getMessageFile), and [listThreadMessageFiles](https://platform.openai.com/docs/api-reference/messages/listMessageFiles)
20-
* **Runs** (🔥 **New**): [createRun](https://platform.openai.com/docs/api-reference/runs/createRun), [createThreadAndRun](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun), [listRuns](https://platform.openai.com/docs/api-reference/runs/listRuns), [retrieveRun](https://platform.openai.com/docs/api-reference/runs/retrieveRun), [modifyRun](https://platform.openai.com/docs/api-reference/runs/modifyRun), [submitToolOutputs](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs), and [cancelRun](https://platform.openai.com/docs/api-reference/runs/cancelRun)
21-
* **Run Steps** (🔥 **New**): [listRunSteps](https://platform.openai.com/docs/api-reference/run-steps/listRunSteps), and [retrieveRunStep](https://platform.openai.com/docs/api-reference/run-steps/getRunStep)
22-
* **Vector Stores** (🔥 **New**): [createVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/create), [listVectorStores](https://platform.openai.com/docs/api-reference/vector-stores/list), [retrieveVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/retrieve), [modifyVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/modify), and [deleteVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/delete)
23-
* **Vector Store Files** (🔥 **New**): [createVectorStoreFile](https://platform.openai.com/docs/api-reference/vector-stores-files/createFile), [listVectorStoreFiles](https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles), [retrieveVectorStoreFile](https://platform.openai.com/docs/api-reference/vector-stores-files/getFile), and [deleteVectorStoreFile](https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile)
24-
* **Vector Store File Batches** (🔥 **New**): [createVectorStoreFileBatch](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch), [retrieveVectorStoreFileBatch](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch), [cancelVectorStoreFileBatch](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch), and [listVectorStoreBatchFiles](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles)
20+
* **Runs**: [createRun](https://platform.openai.com/docs/api-reference/runs/createRun), [createThreadAndRun](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun), [listRuns](https://platform.openai.com/docs/api-reference/runs/listRuns), [retrieveRun](https://platform.openai.com/docs/api-reference/runs/retrieveRun), [modifyRun](https://platform.openai.com/docs/api-reference/runs/modifyRun), [submitToolOutputs](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs), and [cancelRun](https://platform.openai.com/docs/api-reference/runs/cancelRun)
21+
* **Run Steps**: [listRunSteps](https://platform.openai.com/docs/api-reference/run-steps/listRunSteps), and [retrieveRunStep](https://platform.openai.com/docs/api-reference/run-steps/getRunStep)
22+
* **Vector Stores**: [createVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/create), [listVectorStores](https://platform.openai.com/docs/api-reference/vector-stores/list), [retrieveVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/retrieve), [modifyVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/modify), and [deleteVectorStore](https://platform.openai.com/docs/api-reference/vector-stores/delete)
23+
* **Vector Store Files**: [createVectorStoreFile](https://platform.openai.com/docs/api-reference/vector-stores-files/createFile), [listVectorStoreFiles](https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles), [retrieveVectorStoreFile](https://platform.openai.com/docs/api-reference/vector-stores-files/getFile), and [deleteVectorStoreFile](https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile)
24+
* **Vector Store File Batches**: [createVectorStoreFileBatch](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch), [retrieveVectorStoreFileBatch](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch), [cancelVectorStoreFileBatch](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch), and [listVectorStoreBatchFiles](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles)
2525

2626
Note that in order to be consistent with the OpenAI API naming, the service function names match exactly the API endpoint titles/descriptions with camelcase.
2727
Also, we aimed the lib to be self-contained with the fewest dependencies possible therefore we ended up using only two libs `play-ahc-ws-standalone` and `play-ws-standalone-json` (at the top level). Additionally, if dependency injection is required we use `scala-guice` lib as well.
@@ -35,14 +35,16 @@ Also, we aimed the lib to be self-contained with the fewest dependencies possibl
3535
In addition to the OpenAI API, this library also supports API-compatible providers (see [examples](./openai-examples/src/main/scala/io/cequence/openaiscala/examples/nonopenai)) such as:
3636
- [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service) - cloud-based, utilizes OpenAI models but with lower latency
3737
- [Azure AI](https://azure.microsoft.com/en-us/products/ai-studio) - cloud-based, offers a vast selection of open-source models
38-
- [Anthropic](https://www.anthropic.com/api) - cloud-based, a major competitor to OpenAI, features proprietary/closed-source models such as Claude3 - Haiku, Sonnet, and Opus
39-
- [Google Vertex AI](https://cloud.google.com/vertex-ai) (🔥 **New**) - cloud-based, features proprietary/closed-source models such as Gemini 1.5 Pro and flash
38+
- [Anthropic](https://www.anthropic.com/api) - cloud-based, a major competitor to OpenAI, features proprietary/closed-source models such as Claude3 - Haiku, Sonnet, and Opus. 🔥 **New**: now with cache support!
39+
- [Google Vertex AI](https://cloud.google.com/vertex-ai) - cloud-based, features proprietary/closed-source models such as Gemini 1.5 Pro and flash
4040
- [Groq](https://wow.groq.com/) - cloud-based provider, known for its superfast inference with LPUs
41+
- [Grok](https://x.ai/) (🔥 **New**) - cloud-based provider from x.AI
4142
- [Fireworks AI](https://fireworks.ai/) - cloud-based provider
4243
- [OctoAI](https://octo.ai/) - cloud-based provider
43-
- [TogetherAI](https://www.together.ai/) (🔥 **New**) - cloud-based provider
44-
- [Cerebras](https://cerebras.ai/) (🔥 **New**) - cloud-based provider, superfast (akin to Groq)
45-
- [Mistral](https://mistral.ai/) (🔥 **New**) - cloud-based, leading open-source LLM company
44+
- [TogetherAI](https://www.together.ai/) - cloud-based provider
45+
- [Cerebras](https://cerebras.ai/) - cloud-based provider, superfast (akin to Groq)
46+
- [Mistral](https://mistral.ai/) - cloud-based, leading open-source LLM company
47+
- [Deepseek](https://deepseek.com/) (🔥 **New**) - cloud-based provider from China
4648
- [Ollama](https://ollama.com/) - runs locally, serves as an umbrella for open-source LLMs including LLaMA3, dbrx, and Command-R
4749
- [FastChat](https://github.com/lm-sys/FastChat) - runs locally, serves as an umbrella for open-source LLMs such as Vicuna, Alpaca, and FastChat-T5
4850

@@ -159,42 +161,49 @@ Then you can obtain a service in one of the following ways.
159161
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.groq)
160162
```
161163

162-
5. [Fireworks AI](https://fireworks.ai/) - requires `FIREWORKS_API_KEY"`
164+
5. [Grok](https://x.ai) - requires `GROK_API_KEY"`
165+
```scala
166+
val service = OpenAIChatCompletionServiceFactory(ChatProviderSettings.grok)
167+
// or with streaming
168+
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.grok)
169+
```
170+
171+
6. [Fireworks AI](https://fireworks.ai/) - requires `FIREWORKS_API_KEY"`
163172
```scala
164173
val service = OpenAIChatCompletionServiceFactory(ChatProviderSettings.fireworks)
165174
// or with streaming
166175
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.fireworks)
167176
```
168177

169-
6. [Octo AI](https://octo.ai/) - requires `OCTOAI_TOKEN`
178+
7. [Octo AI](https://octo.ai/) - requires `OCTOAI_TOKEN`
170179
```scala
171180
val service = OpenAIChatCompletionServiceFactory(ChatProviderSettings.octoML)
172181
// or with streaming
173182
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.octoML)
174183
```
175184

176-
7. [TogetherAI](https://www.together.ai/) requires `TOGETHERAI_API_KEY`
185+
8. [TogetherAI](https://www.together.ai/) requires `TOGETHERAI_API_KEY`
177186
```scala
178187
val service = OpenAIChatCompletionServiceFactory(ChatProviderSettings.togetherAI)
179188
// or with streaming
180189
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.togetherAI)
181190
```
182191

183-
8. [Cerebras](https://cerebras.ai/) requires `CEREBRAS_API_KEY`
192+
9. [Cerebras](https://cerebras.ai/) requires `CEREBRAS_API_KEY`
184193
```scala
185194
val service = OpenAIChatCompletionServiceFactory(ChatProviderSettings.cerebras)
186195
// or with streaming
187196
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.cerebras)
188197
```
189198

190-
9. [Mistral](https://mistral.ai/) requires `MISTRAL_API_KEY`
199+
10. [Mistral](https://mistral.ai/) requires `MISTRAL_API_KEY`
191200
```scala
192201
val service = OpenAIChatCompletionServiceFactory(ChatProviderSettings.mistral)
193202
// or with streaming
194203
val service = OpenAIChatCompletionServiceFactory.withStreaming(ChatProviderSettings.mistral)
195204
```
196205

197-
10. [Ollama](https://ollama.com/)
206+
11. [Ollama](https://ollama.com/)
198207
```scala
199208
val service = OpenAIChatCompletionServiceFactory(
200209
coreUrl = "http://localhost:11434/v1/"
@@ -249,7 +258,7 @@ or only if streaming is required
249258

250259
Full documentation of each call with its respective inputs and settings is provided in [OpenAIService](./openai-core/src/main/scala/io/cequence/openaiscala/service/OpenAIService.scala). Since all the calls are async they return responses wrapped in `Future`.
251260

252-
🔥 **New**: There is a new project [openai-scala-client-examples](./openai-examples/src/main/scala/io/cequence/openaiscala/examples) where you can find a lot of ready-to-use examples!
261+
There is a new project [openai-scala-client-examples](./openai-examples/src/main/scala/io/cequence/openaiscala/examples) where you can find a lot of ready-to-use examples!
253262

254263
- List models
255264

@@ -403,7 +412,7 @@ For this to work you need to use `OpenAIServiceStreamedFactory` from `openai-sca
403412
}
404413
```
405414

406-
- Create chat completion with json output (🔥 **New**)
415+
- Create chat completion with json output
407416

408417
```scala
409418
val messages = Seq(

0 commit comments

Comments
 (0)