diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 788b0fa..97bce11 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.22.0" + ".": "0.23.0" } diff --git a/.stats.yml b/.stats.yml index d394724..c69c17b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-ee34f94100e35d728e92c54940b84a46f420f476a4b82a33a21728ebf1e9032f.yml -openapi_spec_hash: 5d642c8432d9963281e7db786c2b4e6c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-a2ddf0c5cb796758690f28d02fef6ae46d2eab3fdc3e2d2cf99ef2b75cca4022.yml +openapi_spec_hash: 0f3cd640ddd5f1f4e8ea20b9cfd86025 config_hash: 6b1c374dcc1ffa3165dd22f52a77ff89 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e1e25b..9222dbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.23.0 (2025-05-29) + +Full Changelog: [v0.22.0...v0.23.0](https://github.com/groq/groq-typescript/compare/v0.22.0...v0.23.0) + +### Features + +* **api:** api update ([527632f](https://github.com/groq/groq-typescript/commit/527632fca9ab7589cef1b1eb9e74da6645706433)) +* **api:** api update ([478f2e8](https://github.com/groq/groq-typescript/commit/478f2e8ab8f0c07fe5ae192d00c843b47f78bd6c)) +* **api:** api update ([f25c88a](https://github.com/groq/groq-typescript/commit/f25c88a35d599425abe1e8b53951b4be1066eab5)) + + +### Chores + +* **docs:** grammar improvements ([bd25707](https://github.com/groq/groq-typescript/commit/bd25707f2a699527fb7f8ea9f055e3ef040f29c6)) +* improve publish-npm script --latest tag logic ([40719b5](https://github.com/groq/groq-typescript/commit/40719b543d3cde8a62fb6366ee4fc5f1a1ffa028)) + ## 0.22.0 (2025-05-16) Full Changelog: [v0.21.0...v0.22.0](https://github.com/groq/groq-typescript/compare/v0.21.0...v0.22.0) diff --git a/SECURITY.md b/SECURITY.md index c77277c..01de91e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Groq please follow the respective company's security reporting guidelines. +or products provided by Groq, please follow the respective company's security reporting guidelines. ### Groq Terms and Policies -Please contact support@groq.com for any questions or concerns regarding security of our services. +Please contact support@groq.com for any questions or concerns regarding the security of our services. --- diff --git a/bin/publish-npm b/bin/publish-npm index 4c21181..2505dec 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -4,19 +4,35 @@ set -eux npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" -# Build the project yarn build - -# Navigate to the dist directory cd dist -# Get the version from package.json +# Get latest version from npm +# +# If the package doesn't exist, yarn will return +# {"type":"error","data":"Received invalid response from npm."} +# where .data.version doesn't exist so LAST_VERSION will be an empty string. +LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" + +# Get current version from package.json VERSION="$(node -p "require('./package.json').version")" -# Extract the pre-release tag if it exists +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then - # Extract the part before any dot in the pre-release identifier - TAG="${BASH_REMATCH[1]}" + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" else TAG="latest" fi diff --git a/package.json b/package.json index 118ad81..05ba7f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "groq-sdk", - "version": "0.22.0", + "version": "0.23.0", "description": "The official TypeScript library for the Groq API", "author": "Groq ", "types": "dist/index.d.ts", diff --git a/src/resources/audio/speech.ts b/src/resources/audio/speech.ts index 54f1361..911bd31 100644 --- a/src/resources/audio/speech.ts +++ b/src/resources/audio/speech.ts @@ -48,12 +48,18 @@ export interface SpeechCreateParams { voice: string; /** - * The format to audio in. Supported formats are `wav, mp3`. + * The format of the generated audio. Supported formats are + * `flac, mp3, mulaw, ogg, wav`. */ - response_format?: 'wav' | 'mp3'; + response_format?: 'flac' | 'mp3' | 'mulaw' | 'ogg' | 'wav'; /** - * The speed of the generated audio. 1.0 is the only supported value. + * The sample rate for generated audio + */ + sample_rate?: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000; + + /** + * The speed of the generated audio. */ speed?: number; } diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index ec94518..03e6d47 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -332,6 +332,11 @@ export namespace ChatCompletionChunk { */ type: string; + /** + * Array of code execution results + */ + code_results?: Array; + /** * The output returned by the tool. */ @@ -344,6 +349,18 @@ export namespace ChatCompletionChunk { } export namespace ExecutedTool { + export interface CodeResult { + /** + * Base64 encoded PNG image output from code execution + */ + png?: string; + + /** + * The text version of the code execution result + */ + text?: string; + } + /** * The search results returned by the tool, if applicable. */ @@ -623,6 +640,11 @@ export namespace ChatCompletionMessage { */ type: string; + /** + * Array of code execution results + */ + code_results?: Array; + /** * The output returned by the tool. */ @@ -635,6 +657,18 @@ export namespace ChatCompletionMessage { } export namespace ExecutedTool { + export interface CodeResult { + /** + * Base64 encoded PNG image output from code execution + */ + png?: string; + + /** + * The text version of the code execution result + */ + text?: string; + } + /** * The search results returned by the tool, if applicable. */ @@ -1200,9 +1234,7 @@ export namespace CompletionCreateParams { /** * Whether to enable strict schema adherence when generating the output. If set to * true, the model will always follow the exact schema defined in the `schema` - * field. Only a subset of JSON Schema is supported when `strict` is `true`. To - * learn more, read the - * [Structured Outputs guide](/docs/guides/structured-outputs). + * field. Only a subset of JSON Schema is supported when `strict` is `true`. */ strict?: boolean | null; } diff --git a/src/version.ts b/src/version.ts index db66d33..d77fad4 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.22.0'; // x-release-please-version +export const VERSION = '0.23.0'; // x-release-please-version diff --git a/tests/api-resources/audio/speech.test.ts b/tests/api-resources/audio/speech.test.ts index ac3a237..7f9a239 100644 --- a/tests/api-resources/audio/speech.test.ts +++ b/tests/api-resources/audio/speech.test.ts @@ -14,7 +14,8 @@ describe('resource speech', () => { input: 'The quick brown fox jumped over the lazy dog', model: 'playai-tts', voice: 'Fritz-PlayAI', - response_format: 'wav', + response_format: 'flac', + sample_rate: 48000, speed: 1, }); });