Skip to content

Commit

Permalink
Merge pull request #346 from openai/release-please--branches--master-…
Browse files Browse the repository at this point in the history
…-changes--next--components--openai
  • Loading branch information
athyuttamre authored Oct 3, 2023
2 parents eddb247 + 4bbbedf commit 656cdf1
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 18 deletions.
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.11.0"
".": "4.11.1"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.11.1 (2023-10-03)

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

## 4.11.0 (2023-09-29)

Full Changelog: [v4.10.0...v4.11.0](https://github.com/openai/openai-node/compare/v4.10.0...v4.11.0)
Expand Down
4 changes: 2 additions & 2 deletions bin/check-test-server
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ function prism_is_running() {
}

function is_overriding_api_base_url() {
[ -n "$API_BASE_URL" ]
[ -n "$TEST_API_BASE_URL" ]
}

if is_overriding_api_base_url ; then
# If someone is running the tests against the live API, we can trust they know
# what they're doing and exit early.
echo -e "${GREEN}✔ Running tests against ${API_BASE_URL}${NC}"
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"

exit 0
elif prism_is_running ; then
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.11.0",
"version": "4.11.1",
"description": "Client library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '4.11.0'; // x-release-please-version
export const VERSION = '4.11.1'; // x-release-please-version
5 changes: 4 additions & 1 deletion tests/api-resources/audio/transcriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI, { toFile } from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource transcriptions', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/audio/translations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI, { toFile } from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource translations', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/chat/completions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource completions', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/completions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource completions', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/edits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource edits', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/embeddings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource embeddings', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI, { toFile } from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource files', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/fine-tunes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource fineTunes', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/fine-tuning/jobs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource jobs', () => {
test('create: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI, { toFile } from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource images', () => {
test('createVariation: only required params', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource models', () => {
test('retrieve', async () => {
Expand Down
5 changes: 4 additions & 1 deletion tests/api-resources/moderations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import OpenAI from 'openai';
import { Response } from 'node-fetch';

const openai = new OpenAI({ apiKey: 'something1234', baseURL: 'http://127.0.0.1:4010' });
const openai = new OpenAI({
apiKey: 'something1234',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource moderations', () => {
test('create: only required params', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('instantiate client', () => {

test('custom signal', async () => {
const client = new OpenAI({
baseURL: 'http://127.0.0.1:4010',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
apiKey: 'my api key',
fetch: (...args) => {
return new Promise((resolve, reject) =>
Expand Down

0 comments on commit 656cdf1

Please sign in to comment.