Skip to content

Commit 9b83f1a

Browse files
ci: apply automated fixes
1 parent 914b883 commit 9b83f1a

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

packages/typescript/openai-base/src/adapters/chat-completions-text.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,7 @@ export class OpenAICompatibleChatCompletionsTextAdapter<
459459
messages.push(this.convertMessage(message))
460460
}
461461

462-
const modelOptions = options.modelOptions as
463-
| Record<string, any>
464-
| undefined
462+
const modelOptions = options.modelOptions as Record<string, any> | undefined
465463

466464
return {
467465
model: options.model,

packages/typescript/openai-base/src/utils/schema-converter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export function makeStructuredOutputCompatible(
1515
): Record<string, any> {
1616
const result = { ...schema }
1717
const required =
18-
originalRequired ??
19-
(Array.isArray(result.required) ? result.required : [])
18+
originalRequired ?? (Array.isArray(result.required) ? result.required : [])
2019

2120
if (result.type === 'object' && result.properties) {
2221
const properties = { ...result.properties }

packages/typescript/openai-base/tests/chat-completions-text.test.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,7 @@ describe('OpenAICompatibleChatCompletionsTextAdapter', () => {
751751
{
752752
id: 'chatcmpl-123',
753753
model: 'test-model',
754-
choices: [
755-
{ delta: { content: 'Hi' }, finish_reason: null },
756-
],
754+
choices: [{ delta: { content: 'Hi' }, finish_reason: null }],
757755
},
758756
{
759757
id: 'chatcmpl-123',
@@ -793,9 +791,7 @@ describe('OpenAICompatibleChatCompletionsTextAdapter', () => {
793791
{
794792
id: 'chatcmpl-123',
795793
model: 'test-model',
796-
choices: [
797-
{ delta: { content: 'Hi' }, finish_reason: null },
798-
],
794+
choices: [{ delta: { content: 'Hi' }, finish_reason: null }],
799795
},
800796
{
801797
id: 'chatcmpl-123',
@@ -831,9 +827,7 @@ describe('OpenAICompatibleChatCompletionsTextAdapter', () => {
831827

832828
it('does not include stream_options in structured output calls', async () => {
833829
const nonStreamResponse = {
834-
choices: [
835-
{ message: { content: '{"name":"Alice"}' } },
836-
],
830+
choices: [{ message: { content: '{"name":"Alice"}' } }],
837831
}
838832

839833
setupMockSdkClient([], nonStreamResponse)
@@ -866,9 +860,7 @@ describe('OpenAICompatibleChatCompletionsTextAdapter', () => {
866860
{
867861
id: 'chatcmpl-123',
868862
model: 'test-model',
869-
choices: [
870-
{ delta: { content: 'Hi' }, finish_reason: null },
871-
],
863+
choices: [{ delta: { content: 'Hi' }, finish_reason: null }],
872864
},
873865
{
874866
id: 'chatcmpl-123',
@@ -900,7 +892,9 @@ describe('OpenAICompatibleChatCompletionsTextAdapter', () => {
900892
// Verify second argument contains headers and signal
901893
const requestOptions = mockCreate.mock.calls[0]?.[1]
902894
expect(requestOptions).toBeDefined()
903-
expect(requestOptions.headers).toEqual({ 'X-Custom-Header': 'test-value' })
895+
expect(requestOptions.headers).toEqual({
896+
'X-Custom-Header': 'test-value',
897+
})
904898
expect(requestOptions.signal).toBe(controller.signal)
905899
})
906900
})

0 commit comments

Comments
 (0)