Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1 (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: speakeasybot <[email protected]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Nov 12, 2024
1 parent 7f1d28b commit 794c513
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 36 deletions.
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ sources:
- latest
- main
mistral-google-cloud-source:
sourceNamespace: mistral-openapi-google-cloud
sourceRevisionDigest: sha256:b2ce8e0e63674ea7ccfa3a75ff231bb97a39748331bcc0a3629f29c158f5b31e
sourceBlobDigest: sha256:a895adbf903776492b28daa3dd8c624f509decbbfe9ca6cda6510a33226604be
sourceNamespace: mistral-google-cloud-source
sourceRevisionDigest: sha256:22da209c58cb1591b3fde77467a9affce33c874724b220dd68f11a8f5fe92fbe
sourceBlobDigest: sha256:79c11900db52030ed8d8fff8066f9fe716670f4eadca41936f2cbc1a270fb087
tags:
- latest
- main
Expand All @@ -31,11 +31,11 @@ targets:
codeSamplesRevisionDigest: sha256:859080f8bc0f025db686fb068bea2903ab97b15e55d3c88ad484fe27671b7a1d
mistralai-gcp-sdk:
source: mistral-google-cloud-source
sourceNamespace: mistral-openapi-google-cloud
sourceRevisionDigest: sha256:b2ce8e0e63674ea7ccfa3a75ff231bb97a39748331bcc0a3629f29c158f5b31e
sourceBlobDigest: sha256:a895adbf903776492b28daa3dd8c624f509decbbfe9ca6cda6510a33226604be
sourceNamespace: mistral-google-cloud-source
sourceRevisionDigest: sha256:22da209c58cb1591b3fde77467a9affce33c874724b220dd68f11a8f5fe92fbe
sourceBlobDigest: sha256:79c11900db52030ed8d8fff8066f9fe716670f4eadca41936f2cbc1a270fb087
codeSamplesNamespace: mistral-openapi-google-cloud-code-samples
codeSamplesRevisionDigest: sha256:5126fed27553befa9735d0e0c2abdc089d6f6a22efe89475df630e375b496241
codeSamplesRevisionDigest: sha256:388930534caf7f0c463410313e251ecbbe548002fe9c03fdf0138e738ba4e0e0
mistralai-sdk:
source: mistral-openapi
sourceNamespace: mistral-openapi
Expand Down
10 changes: 5 additions & 5 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: 46baf8da7636ea1bf44557571d011045
docChecksum: a4b0284a2171be4279ac869462fc2ba5
docVersion: 0.0.2
speakeasyVersion: 1.434.7
generationVersion: 2.452.0
releaseVersion: 1.3.0
configChecksum: 3b3800ab2f8b198bdbd47807fbe76770
speakeasyVersion: 1.438.1
generationVersion: 2.457.2
releaseVersion: 1.3.1
configChecksum: 0e5490b5f6a45163ed1ce89547eb8e70
repoURL: https://github.com/mistralai/client-ts.git
repoSubDirectory: packages/mistralai-gcp
installationURL: https://gitpkg.now.sh/mistralai/client-ts/packages/mistralai-gcp
Expand Down
3 changes: 2 additions & 1 deletion packages/mistralai-gcp/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
typescript:
version: 1.3.0
version: 1.3.1
additionalDependencies:
dependencies:
google-auth-library: ^9.11.0
Expand All @@ -22,6 +22,7 @@ typescript:
additionalPackageJSON: {}
author: Speakeasy
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
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 @@ -58,4 +58,14 @@ Based on:
### Generated
- [typescript v1.3.0] packages/mistralai-gcp
### Releases
- [NPM v1.3.0] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.0 - packages/mistralai-gcp
- [NPM v1.3.0] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.0 - packages/mistralai-gcp

## 2024-11-12 18:04:59
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.3.1] packages/mistralai-gcp
### Releases
- [NPM v1.3.1] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.1 - packages/mistralai-gcp
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.0",
"version": "1.3.1",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
4 changes: 2 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.

2 changes: 1 addition & 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.0",
"version": "1.3.1",
"author": "Speakeasy",
"main": "./index.js",
"sideEffects": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/mistralai-gcp/src/funcs/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export async function chatComplete(
const context = {
operationID: "chat_completion_v1_chat_completions_post",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions packages/mistralai-gcp/src/funcs/chatStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export async function chatStream(
const context = {
operationID: "stream_chat",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions packages/mistralai-gcp/src/funcs/fimComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export async function fimComplete(
const context = {
operationID: "fim_completion_v1_fim_completions_post",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions packages/mistralai-gcp/src/funcs/fimStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export async function fimStream(
const context = {
operationID: "stream_fim",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
2 changes: 2 additions & 0 deletions packages/mistralai-gcp/src/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

import { HTTPClient, RequestInput } from "../lib/http.js";
import { RetryConfig } from "../lib/retries.js";
import { SecurityState } from "../lib/security.js";

export type HookContext = {
operationID: string;
oAuth2Scopes?: string[];
securitySource?: any | (() => Promise<any>);
retryConfig: RetryConfig;
resolvedSecurity: SecurityState | null;
};

export type Awaitable<T> = T | Promise<T>;
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.0",
genVersion: "2.452.0",
sdkVersion: "1.3.1",
genVersion: "2.457.2",
userAgent:
"speakeasy-sdk/typescript 1.3.0 2.452.0 0.0.2 @mistralai/mistralai-gcp",
"speakeasy-sdk/typescript 1.3.1 2.457.2 0.0.2 @mistralai/mistralai-gcp",
} as const;
20 changes: 20 additions & 0 deletions packages/mistralai-gcp/src/lib/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/

class InvariantError extends Error {
constructor(message: string) {
super(message);
this.name = "InvariantError";
}
}

export function invariant(
condition: unknown,
message: string,
): asserts condition {
if (!condition) {
throw new InvariantError(message);
}
}

export type ExactPartial<T> = {
[P in keyof T]?: T[P] | undefined;
};

export type Remap<Inp, Mapping extends { [k in keyof Inp]?: string | null }> = {
[k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */
? Mapping[k]
Expand Down
42 changes: 39 additions & 3 deletions packages/mistralai-gcp/src/lib/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

import * as components from "../models/components/index.js";

type OAuth2PasswordFlow = {
username: string;
password?: string | undefined;
clientID: string;
clientSecret?: string | undefined;
tokenURL: string;
};

export enum SecurityErrorCode {
Incomplete = "incomplete",
UnrecognisedSecurityType = "unrecognized_security_type",
Expand Down Expand Up @@ -37,6 +45,7 @@ export type SecurityState = {
headers: Record<string, string>;
queryParams: Record<string, string>;
cookies: Record<string, string>;
oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" };
};

type SecurityInputBasic = {
Expand Down Expand Up @@ -73,7 +82,18 @@ type SecurityInputOAuth2 = {

type SecurityInputOAuth2ClientCredentials = {
type: "oauth2:client_credentials";
value: string | null | undefined;
value:
| { clientID?: string | undefined; clientSecret?: string | undefined }
| null
| undefined;
};

type SecurityInputOAuth2PasswordCredentials = {
type: "oauth2:password";
value:
| string
| null
| undefined;
fieldName: string;
};

Expand All @@ -89,6 +109,7 @@ export type SecurityInput =
| SecurityInputAPIKey
| SecurityInputOAuth2
| SecurityInputOAuth2ClientCredentials
| SecurityInputOAuth2PasswordCredentials
| SecurityInputOIDC
| SecurityInputCustom;

Expand All @@ -100,6 +121,7 @@ export function resolveSecurity(
headers: {},
queryParams: {},
cookies: {},
oauth2: { type: "none" },
};

const option = options.find((opts) => {
Expand All @@ -110,6 +132,12 @@ export function resolveSecurity(
return o.value.username != null || o.value.password != null;
} else if (o.type === "http:custom") {
return null;
} else if (o.type === "oauth2:password") {
return (
typeof o.value === "string" && !!o.value
);
} else if (o.type === "oauth2:client_credentials") {
return o.value.clientID != null || o.value.clientSecret != null;
} else if (typeof o.value === "string") {
return !!o.value;
} else {
Expand Down Expand Up @@ -152,6 +180,9 @@ export function resolveSecurity(
case "oauth2":
applyBearer(state, spec);
break;
case "oauth2:password":
applyBearer(state, spec);
break;
case "oauth2:client_credentials":
break;
case "openIdConnect":
Expand Down Expand Up @@ -179,9 +210,13 @@ function applyBasic(

function applyBearer(
state: SecurityState,
spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC,
spec:
| SecurityInputBearer
| SecurityInputOAuth2
| SecurityInputOIDC
| SecurityInputOAuth2PasswordCredentials,
) {
if (spec.value == null) {
if (typeof spec.value !== "string" || !spec.value) {
return;
}

Expand All @@ -192,6 +227,7 @@ function applyBearer(

state.headers[spec.fieldName] = value;
}

export function resolveGlobalSecurity(
security: Partial<components.Security> | null | undefined,
): SecurityState | null {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType<
tools: z.nullable(z.array(Tool$inboundSchema)).optional(),
tool_choice: z.union([ToolChoice$inboundSchema, ToolChoiceEnum$inboundSchema])
.optional(),
presence_penalty: z.number().default(0),
frequency_penalty: z.number().default(0),
presence_penalty: z.number().optional(),
frequency_penalty: z.number().optional(),
n: z.nullable(z.number().int()).optional(),
}).transform((v) => {
return remap$(v, {
Expand Down Expand Up @@ -324,8 +324,8 @@ export type ChatCompletionRequest$Outbound = {
response_format?: ResponseFormat$Outbound | undefined;
tools?: Array<Tool$Outbound> | null | undefined;
tool_choice?: ToolChoice$Outbound | string | undefined;
presence_penalty: number;
frequency_penalty: number;
presence_penalty?: number | undefined;
frequency_penalty?: number | undefined;
n?: number | null | undefined;
};

Expand Down Expand Up @@ -372,8 +372,8 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType<
ToolChoice$outboundSchema,
ToolChoiceEnum$outboundSchema,
]).optional(),
presencePenalty: z.number().default(0),
frequencyPenalty: z.number().default(0),
presencePenalty: z.number().optional(),
frequencyPenalty: z.number().optional(),
n: z.nullable(z.number().int()).optional(),
}).transform((v) => {
return remap$(v, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType<
tools: z.nullable(z.array(Tool$inboundSchema)).optional(),
tool_choice: z.union([ToolChoice$inboundSchema, ToolChoiceEnum$inboundSchema])
.optional(),
presence_penalty: z.number().default(0),
frequency_penalty: z.number().default(0),
presence_penalty: z.number().optional(),
frequency_penalty: z.number().optional(),
n: z.nullable(z.number().int()).optional(),
}).transform((v) => {
return remap$(v, {
Expand Down Expand Up @@ -317,8 +317,8 @@ export type ChatCompletionStreamRequest$Outbound = {
response_format?: ResponseFormat$Outbound | undefined;
tools?: Array<Tool$Outbound> | null | undefined;
tool_choice?: ToolChoice$Outbound | string | undefined;
presence_penalty: number;
frequency_penalty: number;
presence_penalty?: number | undefined;
frequency_penalty?: number | undefined;
n?: number | null | undefined;
};

Expand Down Expand Up @@ -365,8 +365,8 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType<
ToolChoice$outboundSchema,
ToolChoiceEnum$outboundSchema,
]).optional(),
presencePenalty: z.number().default(0),
frequencyPenalty: z.number().default(0),
presencePenalty: z.number().optional(),
frequencyPenalty: z.number().optional(),
n: z.nullable(z.number().int()).optional(),
}).transform((v) => {
return remap$(v, {
Expand Down

0 comments on commit 794c513

Please sign in to comment.