Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 26, 2024
1 parent e96de18 commit e2db04a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-d9cb66d87629b96a931ce71a189b1482b6ef980aec670e03ffaf75efde6f306a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-f2c71038b5acfa3945dfe9b31211e46e0d3ebc4cba100ce91b04475737aba50f.yml
3 changes: 2 additions & 1 deletion src/resources/audio/transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface TranscriptionCreateParams {
* improve accuracy and latency.
*/
language?:
| (string & {})
| 'en'
| 'zh'
| 'de'
Expand Down Expand Up @@ -142,7 +143,7 @@ export interface TranscriptionCreateParams {
| 'ln'
| 'ha'
| 'ba'
| 'jw'
| 'jv'
| 'su'
| 'yue';

Expand Down
15 changes: 15 additions & 0 deletions src/resources/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,11 @@ export interface ChatCompletionCreateParamsBase {
*/
stream?: boolean | null;

/**
* Options for streaming response. Only set this when you set `stream: true`.
*/
stream_options?: CompletionCreateParams.StreamOptions | null;

/**
* What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
* make the output more random, while lower values like 0.2 will make it more
Expand Down Expand Up @@ -895,6 +900,16 @@ export namespace CompletionCreateParams {
*/
type?: 'text' | 'json_object';
}

/**
* Options for streaming response. Only set this when you set `stream: true`.
*/
export interface StreamOptions {
/**
* This field is unused
*/
include_usage?: boolean;
}
}

export interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/audio/transcriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('resource transcriptions', () => {
const response = await groq.audio.transcriptions.create({
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'whisper-large-v3',
language: 'en',
language: 'string',
prompt: 'string',
response_format: 'json',
temperature: 0,
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/chat/completions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('resource completions', () => {
seed: 0,
stop: '\n',
stream: true,
stream_options: { include_usage: true },
temperature: 1,
tool_choice: 'none',
tools: [
Expand Down

0 comments on commit e2db04a

Please sign in to comment.