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.57.3 #1040

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.57.2"
".": "4.57.3"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 4.57.3 (2024-09-04)

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

### Bug Fixes

* **helpers/zod:** avoid import issue in certain environments ([#1039](https://github.com/openai/openai-node/issues/1039)) ([e238daa](https://github.com/openai/openai-node/commit/e238daa7c12f3fb13369f58b9d405365f5efcc8f))


### Chores

* **internal:** minor bump qs version ([#1037](https://github.com/openai/openai-node/issues/1037)) ([8ec218e](https://github.com/openai/openai-node/commit/8ec218e9efb657927b3c0346822a96872aeaf137))

## 4.57.2 (2024-09-04)

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

```ts
import OpenAI from 'https://deno.land/x/[email protected].2/mod.ts';
import OpenAI from 'https://deno.land/x/[email protected].3/mod.ts';
```

<!-- x-release-please-end -->
Expand Down
5 changes: 5 additions & 0 deletions ecosystem-tests/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const projectRunners = {
'node-ts-esm': defaultNodeRunner,
'node-ts-esm-web': defaultNodeRunner,
'node-ts-esm-auto': defaultNodeRunner,
'node-ts-es2020': async () => {
await installPackage();
await run('npm', ['run', 'tsc']);
await run('npm', ['run', 'main']);
},
'node-js': async () => {
await installPackage();
await run('node', ['test.js']);
Expand Down
36 changes: 36 additions & 0 deletions ecosystem-tests/node-ts-es2020/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { zodResponseFormat } from 'openai/helpers/zod';
import OpenAI from 'openai/index';
import { z } from 'zod';

const Step = z.object({
explanation: z.string(),
output: z.string(),
});

const MathResponse = z.object({
steps: z.array(Step),
final_answer: z.string(),
});

async function main() {
const client = new OpenAI();

const completion = await client.beta.chat.completions.parse({
model: 'gpt-4o-2024-08-06',
messages: [
{ role: 'system', content: 'You are a helpful math tutor.' },
{ role: 'user', content: 'solve 8x + 31 = 2' },
],
response_format: zodResponseFormat(MathResponse, 'math_response'),
});

console.dir(completion, { depth: 5 });

const message = completion.choices[0]?.message;
if (message?.parsed) {
console.log(message.parsed.steps);
console.log(`answer: ${message.parsed.final_answer}`);
}
}

main();
193 changes: 193 additions & 0 deletions ecosystem-tests/node-ts-es2020/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions ecosystem-tests/node-ts-es2020/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "node-ts-es2020",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"tsc": "tsc && tsc -p tsconfig.nodenext.json && tsc -p node_modules/openai/src/tsconfig.json",
"main": "ts-node index.ts"
},
"dependencies": {
"ts-node": "^10.9.2",
"zod": "^3.23.8"
},
"overrides": {
"@types/node": "20.4.2"
}
}
37 changes: 37 additions & 0 deletions ecosystem-tests/node-ts-es2020/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"lib": ["es2020", "dom"],
"allowJs": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"downlevelIteration": true,
"strict": true,
"moduleResolution": "node",
"paths": {},
"typeRoots": ["node_modules/@types"],
"types": ["node"],
"allowSyntheticDefaultImports": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"incremental": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"noFallthroughCasesInSwitch": true,
"preserveSymlinks": true,
"suppressImplicitAnyIndexErrors": true
},
"exclude": ["node_modules"]
}
18 changes: 18 additions & 0 deletions ecosystem-tests/node-ts-es2020/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "./tsconfig.base.json",
"ts-node": {
"swc": true,
"transpileOnly": true
},
"compilerOptions": {
"declaration": false,
"declarationMap": false,
"allowJs": true,
"checkJs": false,
"outDir": "./dist",
"baseUrl": "./",
"types": ["node", "jest"],
"paths": {}
},
"include": ["index.ts", "tsconfig.json", "jest.config.ts", ".eslintrc.js"]
}
Loading