Skip to content

Commit e32b10e

Browse files
committed
Updated to the latest OpenAI API v2.0.0 spec patches
1 parent 9b2c2c7 commit e32b10e

File tree

6 files changed

+146
-98
lines changed

6 files changed

+146
-98
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 0.9.0 - 2023-07-26
4+
### Supported API versions
5+
- OpenAI v2.0.0
6+
- Azure OpenAI v2023-05-15
7+
### Changes
8+
- Updated to the latest OpenAI API v2.0.0 spec patches which includes allowing the content field nullable when function calling. Fixes [Issue 30](https://github.com/wkok/openai-clojure/issues/30)
9+
310
## 0.8.0 - 2023-06-22
411
### Supported API versions
512
- OpenAI v2.0.0

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tools and applications which can work with both variants.
1616
* [Usage - OpenAI](/doc/01-usage-openai.md)
1717
* [Usage - Azure OpenAI](/doc/02-usage-azure.md)
1818
* [Streaming Tokens](/doc/03-streaming.md)
19-
* [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api)
19+
* [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api)
2020

2121
## Supported APIs
2222

@@ -43,13 +43,13 @@ Add the `openai-clojure` dependency
4343
### deps.edn
4444

4545
```
46-
net.clojars.wkok/openai-clojure {:mvn/version "0.8.0"}
46+
net.clojars.wkok/openai-clojure {:mvn/version "0.9.0"}
4747
```
4848

4949
### Leiningen project.clj
5050

5151
```
52-
[net.clojars.wkok/openai-clojure "0.8.0"]
52+
[net.clojars.wkok/openai-clojure "0.9.0"]
5353
```
5454

5555
## Java
@@ -78,7 +78,7 @@ See: [Authentication - Azure OpenAI](/doc/02-usage-azure.md#authentication)
7878

7979
## Quickstart
8080

81-
See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api) for examples of all the supported OpenAI APIs.
81+
See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api) for examples of all the supported OpenAI APIs.
8282

8383
Require the `api` namespace
8484

build.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(:require [org.corfield.build :as bb]))
44

55
(def lib 'net.clojars.wkok/openai-clojure)
6-
(def version "0.8.0")
6+
(def version "0.9.0")
77

88
(defn test "Run the tests." [opts]
99
(bb/run-tests opts))

doc/01-usage-openai.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Add the `openai-clojure` dependency
99
### deps.edn
1010

1111
```
12-
net.clojars.wkok/openai-clojure {:mvn/version "0.8.0"}
12+
net.clojars.wkok/openai-clojure {:mvn/version "0.9.0"}
1313
```
1414

1515
### Leiningen project.clj
1616

1717
```
18-
[net.clojars.wkok/openai-clojure "0.8.0"]
18+
[net.clojars.wkok/openai-clojure "0.9.0"]
1919
```
2020

2121
## Authentication
@@ -43,7 +43,7 @@ Alternatively the `api-key` and/or `organization` can be passed in the `options`
4343

4444
## Quickstart
4545

46-
See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs.
46+
See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs.
4747

4848
Require the `api` namespace
4949

@@ -81,73 +81,73 @@ Result:
8181

8282
### Models
8383

84-
* [list-models](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#list-models)
85-
* [retrieve-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#retrieve-model)
84+
* [list-models](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#list-models)
85+
* [retrieve-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#retrieve-model)
8686

8787
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/models)
8888

8989
### Completions
9090

91-
* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-completion)
91+
* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-completion)
9292

9393
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/completions)
9494

9595
### Chat
9696

97-
* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-chat-completion)
97+
* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-chat-completion)
9898

9999
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/chat)
100100

101101
### Edits
102102

103-
* [create-edit](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-edit)
103+
* [create-edit](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-edit)
104104

105105
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/edits)
106106

107107
### Images
108108

109-
* [create-image](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-image)
110-
* [create-image-edit](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-image-edit)
111-
* [create-image-variation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-image-variation)
109+
* [create-image](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-image)
110+
* [create-image-edit](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-image-edit)
111+
* [create-image-variation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-image-variation)
112112

113113
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/images)
114114

115115
### Embeddings
116116

117-
* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-embedding)
117+
* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-embedding)
118118

119119
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/embeddings)
120120

121121
### Audio
122122

123-
* [create-transcription](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-transcription)
124-
* [create-translation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-translation)
123+
* [create-transcription](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-transcription)
124+
* [create-translation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-translation)
125125

126126
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/audio)
127127

128128
### Files
129129

130-
* [list-files](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#list-files)
131-
* [create-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-file)
132-
* [delete-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#delete-file)
133-
* [retrieve-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#retrieve-file)
134-
* [download-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#download-file)
130+
* [list-files](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#list-files)
131+
* [create-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-file)
132+
* [delete-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#delete-file)
133+
* [retrieve-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#retrieve-file)
134+
* [download-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#download-file)
135135

136136
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/files)
137137

138138
### Fine-tunes
139139

140-
* [create-fine-tune](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-fine-tune)
141-
* [list-fine-tunes](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#list-fine-tunes)
142-
* [retrieve-fine-tune](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#retrieve-fine-tune)
143-
* [cancel-fine-tune](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#cancel-fine-tune)
144-
* [list-fine-tune-events](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#list-fine-tune-events)
145-
* [delete-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#delete-model)
140+
* [create-fine-tune](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-fine-tune)
141+
* [list-fine-tunes](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#list-fine-tunes)
142+
* [retrieve-fine-tune](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#retrieve-fine-tune)
143+
* [cancel-fine-tune](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#cancel-fine-tune)
144+
* [list-fine-tune-events](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#list-fine-tune-events)
145+
* [delete-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#delete-model)
146146

147147
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/fine-tunes)
148148

149149
### Moderations
150150

151-
* [create-moderation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-moderation)
151+
* [create-moderation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-moderation)
152152

153153
Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/moderations)

doc/02-usage-azure.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Add the `openai-clojure` dependency
99
### deps.edn
1010

1111
```
12-
net.clojars.wkok/openai-clojure {:mvn/version "0.8.0"}
12+
net.clojars.wkok/openai-clojure {:mvn/version "0.9.0"}
1313
```
1414

1515
### Leiningen project.clj
1616

1717
```
18-
[net.clojars.wkok/openai-clojure "0.8.0"]
18+
[net.clojars.wkok/openai-clojure "0.9.0"]
1919
```
2020

2121
## Authentication
@@ -44,7 +44,7 @@ Alternatively the `api-key` and/or `api-endpoint` can be passed in the `options`
4444

4545
## Quickstart
4646

47-
See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs.
47+
See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs.
4848

4949
Require the `api` namespace
5050

@@ -83,18 +83,18 @@ Result:
8383

8484
### Completions
8585

86-
* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-completion)
86+
* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-completion)
8787

8888
Also see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#completions)
8989

9090
### Chat
9191

92-
* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-chat-completion)
92+
* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-chat-completion)
9393

9494
Also see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#chat-completions)
9595

9696
### Embeddings
9797

98-
* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.8.0/api/wkok.openai-clojure.api#create-embedding)
98+
* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.9.0/api/wkok.openai-clojure.api#create-embedding)
9999

100100
Also see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#embeddings)

0 commit comments

Comments
 (0)