diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fa672d..8a207ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## 0.18.0 - 2024-06-10 +### Supported API versions +- OpenAI v2.0.0 +- Azure OpenAI v2023-12-01-preview +### Changes +- Updated to latest OpenAI spec commit 4e97768 from 2024-06-07 +- Removed deprecated functions + - list-assistant-files + - create-assistant-file + - retrieve-assistant-file + - delete-assistant-file + - list-message-files + - retrieve-message-file + - submit-tool-outputs-to-run + ## 0.17.0 - 2024-05-19 ### Supported API versions - OpenAI v2.0.0 diff --git a/README.md b/README.md index 466f7b4..5fc3dba 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ tools and applications which can work with both variants. * [Usage - OpenAI](/doc/01-usage-openai.md) * [Usage - Azure OpenAI](/doc/02-usage-azure.md) * [Streaming Tokens](/doc/03-streaming.md) -* [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api) +* [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api) ## Supported APIs @@ -46,13 +46,13 @@ Add the `openai-clojure` dependency ### deps.edn ``` -net.clojars.wkok/openai-clojure {:mvn/version "0.17.0"} +net.clojars.wkok/openai-clojure {:mvn/version "0.18.0"} ``` ### Leiningen project.clj ``` -[net.clojars.wkok/openai-clojure "0.17.0"] +[net.clojars.wkok/openai-clojure "0.18.0"] ``` ## Java @@ -81,7 +81,7 @@ See: [Authentication - Azure OpenAI](/doc/02-usage-azure.md#authentication) ## Quickstart -See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api) for examples of all the supported OpenAI APIs. +See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api) for examples of all the supported OpenAI APIs. Require the `api` namespace diff --git a/build.clj b/build.clj index 19ea95c..8ae7a56 100644 --- a/build.clj +++ b/build.clj @@ -3,7 +3,7 @@ (:require [org.corfield.build :as bb])) (def lib 'net.clojars.wkok/openai-clojure) -(def version "0.17.0") +(def version "0.18.0") (defn test "Run the tests." [opts] (bb/run-tests opts)) diff --git a/deps.edn b/deps.edn index 4d240fa..40aee01 100644 --- a/deps.edn +++ b/deps.edn @@ -11,4 +11,7 @@ :extra-deps {org.clojure/test.check {:mvn/version "1.1.1"} io.github.cognitect-labs/test-runner {:git/tag "v0.5.0" :git/sha "48c3c67"}} - :main-opts ["-e" "(set! *warn-on-reflection* true)"]}}} + + ;; Commented out PR 48 as it causes tests not to run + ;; https://github.com/wkok/openai-clojure/pull/48/files + #_#_:main-opts ["-e" "(set! *warn-on-reflection* true)"]}}} diff --git a/doc/01-usage-openai.md b/doc/01-usage-openai.md index e10c443..972aaee 100644 --- a/doc/01-usage-openai.md +++ b/doc/01-usage-openai.md @@ -9,13 +9,13 @@ Add the `openai-clojure` dependency ### deps.edn ``` -net.clojars.wkok/openai-clojure {:mvn/version "0.17.0"} +net.clojars.wkok/openai-clojure {:mvn/version "0.18.0"} ``` ### Leiningen project.clj ``` -[net.clojars.wkok/openai-clojure "0.17.0"] +[net.clojars.wkok/openai-clojure "0.18.0"] ``` ## Authentication @@ -48,7 +48,7 @@ Alternatively the `api-key` and/or `organization` and/or `api-endpoint` can be p ## Quickstart -See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs. +See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs. Require the `api` namespace @@ -104,70 +104,70 @@ Any of these [supported request options](https://github.com/gnarroway/hato#reque ### Models -* [list-models](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#list-models) -* [retrieve-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#retrieve-model) +* [list-models](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#list-models) +* [retrieve-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#retrieve-model) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/models) ### Completions -* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-completion) +* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-completion) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/completions) ### Chat -* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-chat-completion) +* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-chat-completion) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/chat) ### Images -* [create-image](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-image) -* [create-image-edit](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-image-edit) -* [create-image-variation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-image-variation) +* [create-image](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-image) +* [create-image-edit](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-image-edit) +* [create-image-variation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-image-variation) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/images) ### Embeddings -* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-embedding) +* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-embedding) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/embeddings) ### Audio -* [create-transcription](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-transcription) -* [create-translation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-translation) +* [create-transcription](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-transcription) +* [create-translation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-translation) -* [create-speech](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-speech) +* [create-speech](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-speech) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/audio) ### Files -* [list-files](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#list-files) -* [create-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-file) -* [delete-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#delete-file) -* [retrieve-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#retrieve-file) -* [download-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#download-file) +* [list-files](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#list-files) +* [create-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-file) +* [delete-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#delete-file) +* [retrieve-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#retrieve-file) +* [download-file](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#download-file) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/files) ### Fine-tuning -* [create-fine-tuning-job](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-fine-tuning-job) -* [list-fine-tuning-jobs](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#list-fine-tuning-jobs) -* [retrieve-fine-tuning-job](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#retrieve-fine-tuning-job) -* [cancel-fine-tuning-job](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#cancel-fine-tuning-job) -* [list-fine-tuning-events](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#list-fine-tuning-events) -* [delete-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#delete-model) +* [create-fine-tuning-job](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-fine-tuning-job) +* [list-fine-tuning-jobs](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#list-fine-tuning-jobs) +* [retrieve-fine-tuning-job](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#retrieve-fine-tuning-job) +* [cancel-fine-tuning-job](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#cancel-fine-tuning-job) +* [list-fine-tuning-events](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#list-fine-tuning-events) +* [delete-model](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#delete-model) Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/fine-tuning) ### Moderations -* [create-moderation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-moderation) +* [create-moderation](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-moderation) ### Assistants @@ -176,10 +176,6 @@ Also see the [OpenAI documentation](https://platform.openai.com/docs/api-referen * [modify-assistant](https://platform.openai.com/docs/api-reference/assistants/modifyAssistant) * [delete-assistant](https://platform.openai.com/docs/api-reference/assistants/deleteAssistant) * [list-assistants](https://platform.openai.com/docs/api-reference/assistants/listAssistants) -* [create-assistant-file](https://platform.openai.com/docs/api-reference/assistants/createAssistantFile) -* [retrieve-assistant-file](https://platform.openai.com/docs/api-reference/assistants/getAssistantFile) -* [delete-assistant-file](https://platform.openai.com/docs/api-reference/assistants/deleteAssistantFile) -* [list-assistant-files](https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles) ### Threads @@ -194,8 +190,6 @@ Also see the [OpenAI documentation](https://platform.openai.com/docs/api-referen * [retrieve-message](https://platform.openai.com/docs/api-reference/messages/getMessage) * [modify-message](https://platform.openai.com/docs/api-reference/messages/modifyMessage) * [list-messages](https://platform.openai.com/docs/api-reference/messages/listMessages) -* [retrieve-message-file](https://platform.openai.com/docs/api-reference/messages/getMessageFile) -* [list-message-files](https://platform.openai.com/docs/api-reference/messages/listMessageFiles) ### Runs @@ -204,7 +198,6 @@ Also see the [OpenAI documentation](https://platform.openai.com/docs/api-referen * [modify-run](https://platform.openai.com/docs/api-reference/runs/modifyRun) * [list-runs](https://platform.openai.com/docs/api-reference/runs/listRuns) * [cancel-run](https://platform.openai.com/docs/api-reference/runs/cancelRun) -* [submit-tool-outputs-to-run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) * [retrieve-run-step](https://platform.openai.com/docs/api-reference/runs/getRunStep) * [create-thread-and-run](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun) * [list-run-steps](https://platform.openai.com/docs/api-reference/runs/listRunSteps) diff --git a/doc/02-usage-azure.md b/doc/02-usage-azure.md index 062a300..cfd7e21 100644 --- a/doc/02-usage-azure.md +++ b/doc/02-usage-azure.md @@ -9,13 +9,13 @@ Add the `openai-clojure` dependency ### deps.edn ``` -net.clojars.wkok/openai-clojure {:mvn/version "0.17.0"} +net.clojars.wkok/openai-clojure {:mvn/version "0.18.0"} ``` ### Leiningen project.clj ``` -[net.clojars.wkok/openai-clojure "0.17.0"] +[net.clojars.wkok/openai-clojure "0.18.0"] ``` ## Authentication @@ -44,7 +44,7 @@ Alternatively the `api-key` and/or `api-endpoint` can be passed in the `options` ## Quickstart -See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs. +See the full [API Reference](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api) api documentation for examples of all the supported OpenAI APIs. Require the `api` namespace @@ -102,18 +102,18 @@ Any of these [supported request options](https://github.com/gnarroway/hato#reque ### Completions -* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-completion) +* [create-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-completion) Also see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#completions) ### Chat -* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-chat-completion) +* [create-chat-completion](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-chat-completion) Also see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#chat-completions) ### Embeddings -* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.17.0/api/wkok.openai-clojure.api#create-embedding) +* [create-embedding](https://cljdoc.org/d/net.clojars.wkok/openai-clojure/0.18.0/api/wkok.openai-clojure.api#create-embedding) Also see the [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#embeddings) diff --git a/resources/openapi-README.md b/resources/openapi-README.md index d06166c..7f9d853 100644 --- a/resources/openapi-README.md +++ b/resources/openapi-README.md @@ -2,11 +2,6 @@ Some changes are required in the hosted YAML spec to make it compatible with Martian -## CreateChatCompletionRequest/properties/max_tokens/default - -* from: `inf` -* to: `16384` - ## ChatCompletionFunctions/properties/parameters later: (#/components/schemas/FunctionParameters) diff --git a/resources/openapi.yaml b/resources/openapi.yaml index 91aa202..3f32a98 100644 --- a/resources/openapi.yaml +++ b/resources/openapi.yaml @@ -5032,7 +5032,7 @@ paths: /threads/{thread_id}/runs/{run_id}/submit_tool_outputs: post: - operationId: submitToolOuputsToRun + operationId: submitToolOutputsToRun tags: - Assistants summary: | @@ -7509,7 +7509,7 @@ components: - name required: - role - + # TODO(apeng): This is only because we don't support tools yet. Use allOf once we do. FineTuneChatCompletionRequestAssistantMessage: type: object @@ -7546,7 +7546,7 @@ components: enum: [0, 1] description: "Controls whether the assistant message is trained against (0 or 1)" required: - - role + - role ChatCompletionRequestToolMessage: type: object @@ -7587,7 +7587,7 @@ components: - role - content - name - + # TODO(apeng): This is only because we don't support tools yet. Add back deprecated once we do. FineTuneChatCompletionRequestFunctionMessage: allOf: @@ -7611,8 +7611,7 @@ components: name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: "#/components/schemas/FunctionParameters" + parameters: {} required: - name @@ -7649,8 +7648,7 @@ components: name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: "#/components/schemas/FunctionParameters" + parameters: {} required: - name @@ -9684,7 +9682,7 @@ components: name: Training format for chat models example: | {"messages":[{"role":"user","content":"What is the weather in San Francisco?"},{"role":"assistant","function_call":{"name":"get_current_weather","arguments":"{\"location\": \"San Francisco, USA\", \"format\": \"celsius\"}"}}],"functions":[{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. San Francisco, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}]} - + FinetuneCompletionRequestInput: type: object description: The per-line training example of a fine-tuning input file for completions models @@ -10018,7 +10016,7 @@ components: description: Always `auto`. enum: ["auto"] required: - - type + - type - type: object title: Static Chunking Strategy additionalProperties: false @@ -10040,7 +10038,7 @@ components: type: integer description: | The number of tokens that overlap between chunks. The default value is `400`. - + Note that the overlap must not exceed half of `max_chunk_size_tokens`. required: - max_chunk_size_tokens @@ -11029,7 +11027,7 @@ components: description: Always `auto`. enum: ["auto"] required: - - type + - type - type: object title: Static Chunking Strategy additionalProperties: false @@ -11051,7 +11049,7 @@ components: type: integer description: | The number of tokens that overlap between chunks. The default value is `400`. - + Note that the overlap must not exceed half of `max_chunk_size_tokens`. required: - max_chunk_size_tokens @@ -12598,7 +12596,7 @@ components: type: integer description: | The number of tokens that overlap between chunks. The default value is `400`. - + Note that the overlap must not exceed half of `max_chunk_size_tokens`. required: - max_chunk_size_tokens @@ -13830,4 +13828,4 @@ x-oaiMeta: path: create - type: object key: CreateCompletionResponse - path: object \ No newline at end of file + path: object diff --git a/src/wkok/openai_clojure/api.clj b/src/wkok/openai_clojure/api.clj index 18e2ec9..c4a579c 100644 --- a/src/wkok/openai_clojure/api.clj +++ b/src/wkok/openai_clojure/api.clj @@ -511,85 +511,6 @@ (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] (core/response-for :delete-assistant params opts)))) - -(defn list-assistant-files - "Returns a list of assistant files. - - Example: - ``` - (list-assistant-files {:assistant_id \"----id----\" - :limit 5}) - ``` - :assistant_id param required - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles) - " - ([params] - (list-assistant-files params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :list-assistant-files params opts)))) - - - -(defn create-assistant-file - "Create an assistant file by attaching a File to an assistant. - - Example: - ``` - (create-assistant-file {:assistant_id \"----id----\" - :file_id \"----id----\"}) - ``` - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/assistants/createAssistantFile) - " - ([params] - (create-assistant-file params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :create-assistant-file params opts)))) - - - -(defn retrieve-assistant-file - "Retrieves an AssistantFile. - - Example: - ``` - (retrieve-assistant-file {:assistant_id \"----id----\" - :file_id \"----id----\"}) - ``` - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/assistants/getAssistantFile) - " - ([params] - (retrieve-assistant-file params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :get-assistant-file params opts)))) - - -(defn delete-assistant-file - "Delete an assistant file. - - Example: - ``` - (delete-assistant-file {:assistant_id \"----id----\" - :file_id \"----id----\"}) - ``` - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/assistants/deleteAssistantFile) - " - ([params] - (delete-assistant-file params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :delete-assistant-file params opts)))) - - - - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Threads (beta) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -752,48 +673,6 @@ (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] (core/response-for :modify-message params opts)))) - - -(defn list-message-files - "Returns a list of message files. - - Example: - ``` - (list-message-files {:thread_id \"----id----\" - :message_id \"----id----\"}) - ``` - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/messages/listMessageFiles) - " - ([params] - (list-message-files params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :list-message-files params opts)))) - - - -(defn retrieve-message-file - "Retrieves a message file. - - Example: - ``` - (retrieve-message-file {:thread_id \"----id----\" - :message_id \"----id----\" - :file_id \"----id----\"}) - ``` - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/messages/getMessageFile) - " - ([params] - (retrieve-message-file params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :get-message-file params opts)))) - - - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Runs (beta) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -873,30 +752,6 @@ (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] (core/response-for :modify-run params opts)))) - - -(defn submit-tool-outputs-to-run - "When a run has the `status: \"requires_action\"` and `required_action.type` is - `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool - calls once they're all completed. All outputs must be submitted in a single request. - - Example: - - ``` - (submit-tool-outputs-to-run {:thread_id \"----id----\" - :run_id \"----id----\" - :tool_outputs [{:tool_call_id \"call_wwg3TXXXF0SCT7UTTvqxjZc\" - :output \"Budapest, Hungary\"}]}) - ``` - - Also see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) - " - ([params] - (submit-tool-outputs-to-run params nil)) - ([params options] - (let [opts (assoc-in options [:openai-beta] ASSISTANTS_HTTP_HEADER_STR)] - (core/response-for :submit-tool-ouputs-to-run params opts)))) - (defn list-run-steps "Returns a list of run steps belonging to a run. diff --git a/test/wkok/openai_clojure/api_test.clj b/test/wkok/openai_clojure/api_test.clj index 7f0dc45..cb40517 100644 --- a/test/wkok/openai_clojure/api_test.clj +++ b/test/wkok/openai_clojure/api_test.clj @@ -202,22 +202,6 @@ (is (= :success (api/delete-assistant {:assistant_id "----id----"}))) - (is (= :success - (api/list-assistant-files {:assistant_id "----id----" - :limit 5}))) - - (is (= :success - (api/create-assistant-file {:assistant_id "----id----" - :file_id "----id----"}))) - - (is (= :success - (api/retrieve-assistant-file {:assistant_id "----id----" - :file_id "----id----"}))) - - (is (= :success - (api/delete-assistant-file {:assistant_id "----id----" - :file_id "----id----"}))) - (is (= :success (api/create-thread))) @@ -254,15 +238,6 @@ (api/modify-message {:thread_id "----id----" :message_id "----id----"}))) - (is (= :success - (api/list-message-files {:thread_id "----id----" - :message_id "----id----"}))) - - (is (= :success - (api/retrieve-message-file {:thread_id "----id----" - :message_id "----id----" - :file_id "----id----"}))) - (is (= :success (api/list-runs {:thread_id "----id----"}))) @@ -278,12 +253,6 @@ (api/modify-run {:thread_id "----id----" :run_id "----id----"}))) - (is (= :success - (api/submit-tool-outputs-to-run {:thread_id "----id----" - :run_id "----id----" - :tool_outputs [{:tool_call_id "call_wwg3TXXXF0SCT7UTTvqxjZc" - :output "Budapest, Hungary"}]}))) - (is (= :success (api/list-run-steps {:thread_id "----id----" :run_id "----id----"})))