Skip to content

Commit

Permalink
Merge pull request #61 from mistralai/speakeasy-sdk-regen-1733235231
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate MISTRALAI-GCP-SDK 1.3.5
  • Loading branch information
aac228 authored Dec 4, 2024
2 parents b01c1e7 + 8f98d5a commit e6900ad
Show file tree
Hide file tree
Showing 42 changed files with 962 additions and 40 deletions.
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.438.1
speakeasyVersion: 1.451.1
sources:
mistral-azure-source:
sourceNamespace: mistral-azure-source
Expand All @@ -9,11 +9,11 @@ sources:
- main
mistral-google-cloud-source:
sourceNamespace: mistral-google-cloud-source
sourceRevisionDigest: sha256:d3e3d15303dcc1acb27b8895aa3064328bd5b8013ea635c2bce553b6e647b498
sourceBlobDigest: sha256:db72004ee842a27c3e77980be28a727811e0581daa7a51ad34d142302f8ba2f3
sourceRevisionDigest: sha256:e0fd58ce2dbba068f375d3a23d758b8678c2a68cf4fc7bc46ea7e1b37abe0647
sourceBlobDigest: sha256:0707d8d2566a9ef4ef286bb0abe467f8696ccf83ba73091065d7caf627a06611
tags:
- latest
- main
- speakeasy-sdk-regen-1733235231
mistral-openapi:
sourceNamespace: mistral-openapi
sourceRevisionDigest: sha256:9b6ad47076b570f4e23494bf744a7822547d0003e4b10985f26f1c3b5128e631
Expand All @@ -32,10 +32,10 @@ targets:
mistralai-gcp-sdk:
source: mistral-google-cloud-source
sourceNamespace: mistral-google-cloud-source
sourceRevisionDigest: sha256:d3e3d15303dcc1acb27b8895aa3064328bd5b8013ea635c2bce553b6e647b498
sourceBlobDigest: sha256:db72004ee842a27c3e77980be28a727811e0581daa7a51ad34d142302f8ba2f3
sourceRevisionDigest: sha256:e0fd58ce2dbba068f375d3a23d758b8678c2a68cf4fc7bc46ea7e1b37abe0647
sourceBlobDigest: sha256:0707d8d2566a9ef4ef286bb0abe467f8696ccf83ba73091065d7caf627a06611
codeSamplesNamespace: mistral-openapi-google-cloud-code-samples
codeSamplesRevisionDigest: sha256:5dc48a4ede0443945c76f9c50a0f87da055605d2599ee64ba4953553cc0ec1c5
codeSamplesRevisionDigest: sha256:9c3e749304cf1c4e6380d8d0b1aa375d0871e2b8843e7fac3fbd305727611f3f
mistralai-sdk:
source: mistral-openapi
sourceNamespace: mistral-openapi
Expand Down
14 changes: 7 additions & 7 deletions packages/mistralai-gcp/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: c6044247-eaf9-46da-b078-0e1334e93be2
management:
docChecksum: e6c0a4254e61b1f171b409862f717867
docChecksum: d50a06ac34844141709fa2e57cc940c5
docVersion: 0.0.2
speakeasyVersion: 1.438.1
generationVersion: 2.457.2
releaseVersion: 1.3.4
configChecksum: dda464868f797196bfe7e83112f0516b
speakeasyVersion: 1.451.1
generationVersion: 2.470.1
releaseVersion: 1.3.5
configChecksum: 919939b6307829dceea203eaa634d4ec
repoURL: https://github.com/mistralai/client-ts.git
repoSubDirectory: packages/mistralai-gcp
installationURL: https://gitpkg.now.sh/mistralai/client-ts/packages/mistralai-gcp
Expand All @@ -15,7 +15,7 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.18.3
core: 3.18.8
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.2
Expand All @@ -33,7 +33,6 @@ features:
serverEvents: 0.1.5
serverEventsSentinels: 0.1.0
serverIDs: 2.81.2
tests: 0.7.0
unions: 2.85.8
generatedFiles:
- .eslintrc.cjs
Expand Down Expand Up @@ -198,3 +197,4 @@ examples:
"200":
application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "finish_reason": "stop"}, {"index": 0, "finish_reason": "stop"}, {"index": 0, "finish_reason": "stop"}]}
"422": {}
generatedTests: {}
1 change: 1 addition & 0 deletions packages/mistralai-gcp/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ typescript:
author: Speakeasy
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
enableReactQuery: false
enumFormat: union
flattenGlobalSecurity: true
flatteningOrder: body-first
Expand Down
12 changes: 11 additions & 1 deletion packages/mistralai-gcp/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,14 @@ Based on:
### Generated
- [typescript v1.3.4] packages/mistralai-gcp
### Releases
- [NPM v1.3.4] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.4 - packages/mistralai-gcp
- [NPM v1.3.4] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.4 - packages/mistralai-gcp

## 2024-12-04 09:25:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.451.1 (2.470.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.3.5] packages/mistralai-gcp
### Releases
- [NPM v1.3.5] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.5 - packages/mistralai-gcp
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ let value: ReferenceChunk = {

| Field | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `type` | [components.ReferenceChunkType](../../models/components/referencechunktype.md) | :heavy_minus_sign: | N/A |
| `referenceIds` | *number*[] | :heavy_check_mark: | N/A |
| `referenceIds` | *number*[] | :heavy_check_mark: | N/A |
| `type` | [components.ReferenceChunkType](../../models/components/referencechunktype.md) | :heavy_minus_sign: | N/A |
4 changes: 2 additions & 2 deletions packages/mistralai-gcp/docs/models/components/textchunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ let value: TextChunk = {

| Field | Type | Required | Description |
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
| `type` | [components.Type](../../models/components/type.md) | :heavy_minus_sign: | N/A |
| `text` | *string* | :heavy_check_mark: | N/A |
| `text` | *string* | :heavy_check_mark: | N/A |
| `type` | [components.Type](../../models/components/type.md) | :heavy_minus_sign: | N/A |
2 changes: 1 addition & 1 deletion packages/mistralai-gcp/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@mistralai/mistralai-gcp",
"version": "1.3.4",
"version": "1.3.5",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
63 changes: 61 additions & 2 deletions packages/mistralai-gcp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/mistralai-gcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mistralai/mistralai-gcp",
"version": "1.3.4",
"version": "1.3.5",
"author": "Speakeasy",
"main": "./index.js",
"sideEffects": false,
Expand All @@ -15,6 +15,8 @@
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"react": "^18 || ^19",
"react-dom": "^18 || ^19",
"zod": ">= 3"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/mistralai-gcp/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "0.0.2",
sdkVersion: "1.3.4",
genVersion: "2.457.2",
sdkVersion: "1.3.5",
genVersion: "2.470.1",
userAgent:
"speakeasy-sdk/typescript 1.3.4 2.457.2 0.0.2 @mistralai/mistralai-gcp",
"speakeasy-sdk/typescript 1.3.5 2.470.1 0.0.2 @mistralai/mistralai-gcp",
} as const;
2 changes: 1 addition & 1 deletion packages/mistralai-gcp/src/lib/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function match<T, E>(
raw = await response.json();
break;
case "bytes":
raw = await response.arrayBuffer();
raw = new Uint8Array(await response.arrayBuffer());
break;
case "stream":
raw = response.body;
Expand Down
62 changes: 62 additions & 0 deletions packages/mistralai-gcp/src/lib/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,65 @@ export function remap<

return out;
}

export function combineSignals(
...signals: Array<AbortSignal | null | undefined>
): AbortSignal | null {
const filtered: AbortSignal[] = [];
for (const signal of signals) {
if (signal) {
filtered.push(signal);
}
}

switch (filtered.length) {
case 0:
case 1:
return filtered[0] || null;
default:
if ("any" in AbortSignal && typeof AbortSignal.any === "function") {
return AbortSignal.any(filtered);
}
return abortSignalAny(filtered);
}
}

export function abortSignalAny(signals: AbortSignal[]): AbortSignal {
const controller = new AbortController();
const result = controller.signal;
if (!signals.length) {
return controller.signal;
}

if (signals.length === 1) {
return signals[0] || controller.signal;
}

for (const signal of signals) {
if (signal.aborted) {
return signal;
}
}

function abort(this: AbortSignal) {
controller.abort(this.reason);
clean();
}

const signalRefs: WeakRef<AbortSignal>[] = [];
function clean() {
for (const signalRef of signalRefs) {
const signal = signalRef.deref();
if (signal) {
signal.removeEventListener("abort", abort);
}
}
}

for (const signal of signals) {
signalRefs.push(new WeakRef(signal));
signal.addEventListener("abort", abort);
}

return result;
}
Loading

0 comments on commit e6900ad

Please sign in to comment.