Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 4.17.0 #468

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.16.2"
".": "4.17.0"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 4.17.0 (2023-11-08)

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

### Features

* **api:** unify function types ([#467](https://github.com/openai/openai-node/issues/467)) ([d51cd94](https://github.com/openai/openai-node/commit/d51cd94b3103219789447e2e9afc4762ae672e5a))


### Refactors

* **api:** rename FunctionObject to FunctionDefinition ([#470](https://github.com/openai/openai-node/issues/470)) ([f3990c7](https://github.com/openai/openai-node/commit/f3990c779e596309b62f41d7a1253d8629aca3bf))

## 4.16.2 (2023-11-08)

Full Changelog: [v4.16.1...v4.16.2](https://github.com/openai/openai-node/compare/v4.16.1...v4.16.2)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can import in Deno via:
<!-- x-release-please-start-version -->

```ts
import OpenAI from 'https://deno.land/x/openai@v4.16.2/mod.ts';
import OpenAI from 'https://deno.land/x/openai@v4.17.0/mod.ts';
```

<!-- x-release-please-end -->
Expand Down
7 changes: 7 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Shared

Types:

- <code><a href="./src/resources/shared.ts">FunctionDefinition</a></code>
- <code><a href="./src/resources/shared.ts">FunctionParameters</a></code>

# Completions

Types:
Expand Down
2 changes: 1 addition & 1 deletion build-deno
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is a build produced from https://github.com/openai/openai-node – please g
Usage:

\`\`\`ts
import OpenAI from "$(echo 'https://deno.land/x/openai@v4.16.1/mod.ts' | sed -E s/@\.+\\//@"$PACKAGE_VERSION"\\//)";
import OpenAI from "$(echo 'https://deno.land/x/openai@v4.16.2/mod.ts' | sed -E s/@\.+\\//@"$PACKAGE_VERSION"\\//)";

const client = new OpenAI();
\`\`\`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "4.16.2",
"version": "4.17.0",
"description": "Client library for the OpenAI API",
"author": "OpenAI <support@openai.com>",
"types": "dist/index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ export namespace OpenAI {
export import FineTuneListEventsParamsStreaming = API.FineTuneListEventsParamsStreaming;

export import Beta = API.Beta;

export import FunctionDefinition = API.FunctionDefinition;
export import FunctionParameters = API.FunctionParameters;
}

export default OpenAI;
109 changes: 4 additions & 105 deletions src/resources/beta/assistants/assistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as Core from 'openai/core';
import { APIResource } from 'openai/resource';
import { isRequestOptions } from 'openai/core';
import * as AssistantsAPI from 'openai/resources/beta/assistants/assistants';
import * as Shared from 'openai/resources/shared';
import * as FilesAPI from 'openai/resources/beta/assistants/files';
import { CursorPage, type CursorPageParams } from 'openai/pagination';

Expand Down Expand Up @@ -163,47 +164,13 @@ export namespace Assistant {
}

export interface Function {
/**
* The function definition.
*/
function: Function.Function;
function: Shared.FunctionDefinition;

/**
* The type of tool being defined: `function`
*/
type: 'function';
}

export namespace Function {
/**
* The function definition.
*/
export interface Function {
/**
* A description of what the function does, used by the model to choose when and
* how to call the function.
*/
description: string;

/**
* 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.
*/
name: string;

/**
* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
* examples, and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
* documentation about the format.
*
* To describe a function that accepts no parameters, provide the value
* `{"type": "object", "properties": {}}`.
*/
parameters: Record<string, unknown>;
}
}
}

export interface AssistantDeleted {
Expand Down Expand Up @@ -282,47 +249,13 @@ export namespace AssistantCreateParams {
}

export interface AssistantToolsFunction {
/**
* The function definition.
*/
function: AssistantToolsFunction.Function;
function: Shared.FunctionDefinition;

/**
* The type of tool being defined: `function`
*/
type: 'function';
}

export namespace AssistantToolsFunction {
/**
* The function definition.
*/
export interface Function {
/**
* A description of what the function does, used by the model to choose when and
* how to call the function.
*/
description: string;

/**
* 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.
*/
name: string;

/**
* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
* examples, and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
* documentation about the format.
*
* To describe a function that accepts no parameters, provide the value
* `{"type": "object", "properties": {}}`.
*/
parameters: Record<string, unknown>;
}
}
}

export interface AssistantUpdateParams {
Expand Down Expand Up @@ -395,47 +328,13 @@ export namespace AssistantUpdateParams {
}

export interface AssistantToolsFunction {
/**
* The function definition.
*/
function: AssistantToolsFunction.Function;
function: Shared.FunctionDefinition;

/**
* The type of tool being defined: `function`
*/
type: 'function';
}

export namespace AssistantToolsFunction {
/**
* The function definition.
*/
export interface Function {
/**
* A description of what the function does, used by the model to choose when and
* how to call the function.
*/
description: string;

/**
* 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.
*/
name: string;

/**
* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
* examples, and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
* documentation about the format.
*
* To describe a function that accepts no parameters, provide the value
* `{"type": "object", "properties": {}}`.
*/
parameters: Record<string, unknown>;
}
}
}

export interface AssistantListParams extends CursorPageParams {
Expand Down
77 changes: 5 additions & 72 deletions src/resources/beta/threads/runs/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as Core from 'openai/core';
import { APIResource } from 'openai/resource';
import { isRequestOptions } from 'openai/core';
import * as RunsAPI from 'openai/resources/beta/threads/runs/runs';
import * as Shared from 'openai/resources/shared';
import * as StepsAPI from 'openai/resources/beta/threads/runs/steps';
import { CursorPage, type CursorPageParams } from 'openai/pagination';

Expand Down Expand Up @@ -221,9 +222,9 @@ export interface Run {
model: string;

/**
* The object type, which is always `assistant.run`.
* The object type, which is always `thread.run`.
*/
object: 'assistant.run';
object: 'thread.run';

/**
* Details on the action required to continue the run. Will be `null` if no action
Expand Down Expand Up @@ -324,47 +325,13 @@ export namespace Run {
}

export interface AssistantToolsFunction {
/**
* The function definition.
*/
function: AssistantToolsFunction.Function;
function: Shared.FunctionDefinition;

/**
* The type of tool being defined: `function`
*/
type: 'function';
}

export namespace AssistantToolsFunction {
/**
* The function definition.
*/
export interface Function {
/**
* A description of what the function does, used by the model to choose when and
* how to call the function.
*/
description: string;

/**
* 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.
*/
name: string;

/**
* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
* examples, and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
* documentation about the format.
*
* To describe a function that accepts no parameters, provide the value
* `{"type": "object", "properties": {}}`.
*/
parameters: Record<string, unknown>;
}
}
}

export interface RunCreateParams {
Expand Down Expand Up @@ -424,47 +391,13 @@ export namespace RunCreateParams {
}

export interface AssistantToolsFunction {
/**
* The function definition.
*/
function: AssistantToolsFunction.Function;
function: Shared.FunctionDefinition;

/**
* The type of tool being defined: `function`
*/
type: 'function';
}

export namespace AssistantToolsFunction {
/**
* The function definition.
*/
export interface Function {
/**
* A description of what the function does, used by the model to choose when and
* how to call the function.
*/
description: string;

/**
* 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.
*/
name: string;

/**
* The parameters the functions accepts, described as a JSON Schema object. See the
* [guide](https://platform.openai.com/docs/guides/gpt/function-calling) for
* examples, and the
* [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
* documentation about the format.
*
* To describe a function that accepts no parameters, provide the value
* `{"type": "object", "properties": {}}`.
*/
parameters: Record<string, unknown>;
}
}
}

export interface RunUpdateParams {
Expand Down
8 changes: 4 additions & 4 deletions src/resources/beta/threads/runs/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ export interface RunStep {
metadata: unknown | null;

/**
* The object type, which is always `assistant.run.step``.
* The object type, which is always `thread.run.step``.
*/
object: 'assistant.run.step';
object: 'thread.run.step';

/**
* The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that
Expand All @@ -280,8 +280,8 @@ export interface RunStep {
run_id: string;

/**
* The status of the run, which can be either `in_progress`, `cancelled`, `failed`,
* `completed`, or `expired`.
* The status of the run step, which can be either `in_progress`, `cancelled`,
* `failed`, `completed`, or `expired`.
*/
status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired';

Expand Down
Loading