Skip to content

Commit

Permalink
chore(deno): release 4.39.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-cypress committed Apr 29, 2024
1 parent be43b7c commit e760d1f
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 35 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 4.39.0 (2024-04-29)

Full Changelog:
[v4.38.5...v4.39.0](https://github.com/openai/openai-node/compare/v4.38.5...v4.39.0)

### Features

- **api:** add required tool_choice
([#803](https://github.com/openai/openai-node/issues/803))
([99693e6](https://github.com/openai/openai-node/commit/99693e61debc67327a45dffb2c10c113341bffd6))

### Chores

- **internal:** add scripts/test and scripts/mock
([#801](https://github.com/openai/openai-node/issues/801))
([6656105](https://github.com/openai/openai-node/commit/6656105fa1346a91d17e2b7a5e075f3091310c2f))

## 4.38.5 (2024-04-24)

Full Changelog:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ there to read the source and docs, file issues, etc.
Usage:

```ts
import OpenAI from "https://deno.land/x/openai@v4.38.5/mod.ts";
import OpenAI from "https://deno.land/x/openai@v4.39.0/mod.ts";

const client = new OpenAI();
```
Expand Down
25 changes: 15 additions & 10 deletions resources/beta/threads/runs/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,9 @@ export interface Run {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down Expand Up @@ -758,8 +759,9 @@ export interface RunCreateParamsBase {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down Expand Up @@ -1011,8 +1013,9 @@ export interface RunCreateAndPollParams {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down Expand Up @@ -1219,8 +1222,9 @@ export interface RunCreateAndStreamParams {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down Expand Up @@ -1425,8 +1429,9 @@ export interface RunStreamParams {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down
26 changes: 17 additions & 9 deletions resources/beta/threads/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,17 @@ export interface AssistantToolChoiceFunction {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
export type AssistantToolChoiceOption = "none" | "auto" | AssistantToolChoice;
export type AssistantToolChoiceOption =
| "none"
| "auto"
| "required"
| AssistantToolChoice;

/**
* Represents a thread that contains
Expand Down Expand Up @@ -580,8 +585,9 @@ export interface ThreadCreateAndRunParamsBase {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down Expand Up @@ -939,8 +945,9 @@ export interface ThreadCreateAndRunPollParams {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down Expand Up @@ -1273,8 +1280,9 @@ export interface ThreadCreateAndRunStreamParams {
/**
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tools and instead generates a message. `auto` is the default value
* and means the model can pick between generating a message or calling a tool.
* Specifying a particular tool like `{"type": "file_search"}` or
* and means the model can pick between generating a message or calling one or more
* tools. `required` means the model must call one or more tools before responding
* to the user. Specifying a particular tool like `{"type": "file_search"}` or
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that tool.
*/
Expand Down
29 changes: 15 additions & 14 deletions resources/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,19 +620,20 @@ export interface ChatCompletionTool {
}

/**
* Controls which (if any) function is called by the model. `none` means the model
* will not call a function and instead generates a message. `auto` means the model
* can pick between generating a message or calling a function. Specifying a
* particular function via
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tool and instead generates a message. `auto` means the model can
* pick between generating a message or calling one or more tools. `required` means
* the model must call one or more tools. Specifying a particular tool via
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that function.
* call that tool.
*
* `none` is the default when no functions are present. `auto` is the default if
* functions are present.
* `none` is the default when no tools are present. `auto` is the default if tools
* are present.
*/
export type ChatCompletionToolChoiceOption =
| "none"
| "auto"
| "required"
| ChatCompletionNamedToolChoice;

export interface ChatCompletionToolMessageParam {
Expand Down Expand Up @@ -821,15 +822,15 @@ export interface ChatCompletionCreateParamsBase {
temperature?: number | null;

/**
* Controls which (if any) function is called by the model. `none` means the model
* will not call a function and instead generates a message. `auto` means the model
* can pick between generating a message or calling a function. Specifying a
* particular function via
* Controls which (if any) tool is called by the model. `none` means the model will
* not call any tool and instead generates a message. `auto` means the model can
* pick between generating a message or calling one or more tools. `required` means
* the model must call one or more tools. Specifying a particular tool via
* `{"type": "function", "function": {"name": "my_function"}}` forces the model to
* call that function.
* call that tool.
*
* `none` is the default when no functions are present. `auto` is the default if
* functions are present.
* `none` is the default when no tools are present. `auto` is the default if tools
* are present.
*/
tool_choice?: ChatCompletionToolChoiceOption;

Expand Down
2 changes: 1 addition & 1 deletion version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = "4.38.5"; // x-release-please-version
export const VERSION = "4.39.0"; // x-release-please-version

0 comments on commit e760d1f

Please sign in to comment.