Skip to content

Commit e63f965

Browse files
authored
Merge pull request #726 from narengogi/chore/support-new-openai-params
add a few supported input parameters for openai
2 parents 14b1139 + fc72d4d commit e63f965

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

src/providers/azure-openai/chatComplete.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,21 @@ export const AzureOpenAIChatCompleteConfig: ProviderConfig = {
8787
response_format: {
8888
param: 'response_format',
8989
},
90+
store: {
91+
param: 'store',
92+
},
93+
metadata: {
94+
param: 'metadata',
95+
},
96+
modalities: {
97+
param: 'modalities',
98+
},
99+
audio: {
100+
param: 'audio',
101+
},
102+
seed: {
103+
param: 'seed',
104+
},
90105
};
91106

92107
interface AzureOpenAIChatCompleteResponse extends ChatCompletionResponse {}

src/providers/openai/chatComplete.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ export const OpenAIChatCompleteConfig: ProviderConfig = {
9999
max_completion_tokens: {
100100
param: 'max_completion_tokens',
101101
},
102+
store: {
103+
param: 'store',
104+
},
105+
metadata: {
106+
param: 'metadata',
107+
},
108+
modalities: {
109+
param: 'modalities',
110+
},
111+
audio: {
112+
param: 'audio',
113+
},
102114
};
103115

104116
export interface OpenAIChatCompleteResponse extends ChatCompletionResponse {

src/types/requestBody.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ export interface Params {
310310
n?: number;
311311
stream?: boolean;
312312
logprobs?: number;
313+
top_logprobs?: boolean;
313314
echo?: boolean;
314315
stop?: string | string[];
315316
presence_penalty?: number;
@@ -326,6 +327,15 @@ export interface Params {
326327
type: 'json_object' | 'text' | 'json_schema';
327328
json_schema?: any;
328329
};
330+
seed?: number;
331+
store?: boolean;
332+
metadata?: object;
333+
modalities?: string[];
334+
audio?: {
335+
voice: string;
336+
format: string;
337+
};
338+
service_tier?: string;
329339
// Google Vertex AI specific
330340
safety_settings?: any;
331341
// Anthropic specific

0 commit comments

Comments
 (0)