Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1 (#47)
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 fb30d83 commit 8f86876
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 47 deletions.
22 changes: 8 additions & 14 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
speakeasyVersion: 1.434.7
speakeasyVersion: 1.438.1
sources:
mistral-azure-source:
sourceNamespace: mistral-openapi-azure
sourceRevisionDigest: sha256:8fda8235e30128cc8e1c4e1b828316551d03b584568789f262dc287b81d584ee
sourceBlobDigest: sha256:3c039e1f8a2230a86b0e1acec6224f6b8d6f181fb222b6b3b39d38b52075a8ec
sourceNamespace: mistral-azure-source
sourceRevisionDigest: sha256:2e3e3792ec63f3d59dd2a4de2f97ea6a80bd46f8905576069c54810feb930c12
sourceBlobDigest: sha256:da059f78d331ea36f2ec69dfc6c5aa65be0bf0eda011597281cea6499b7ebac8
tags:
- latest
- main
Expand All @@ -24,11 +24,11 @@ sources:
targets:
mistralai-azure-sdk:
source: mistral-azure-source
sourceNamespace: mistral-openapi-azure
sourceRevisionDigest: sha256:8fda8235e30128cc8e1c4e1b828316551d03b584568789f262dc287b81d584ee
sourceBlobDigest: sha256:3c039e1f8a2230a86b0e1acec6224f6b8d6f181fb222b6b3b39d38b52075a8ec
sourceNamespace: mistral-azure-source
sourceRevisionDigest: sha256:2e3e3792ec63f3d59dd2a4de2f97ea6a80bd46f8905576069c54810feb930c12
sourceBlobDigest: sha256:da059f78d331ea36f2ec69dfc6c5aa65be0bf0eda011597281cea6499b7ebac8
codeSamplesNamespace: mistral-openapi-azure-code-samples
codeSamplesRevisionDigest: sha256:4a8b99cbb396d2379d09fadfa9e09c3f402bfccbee8bddeaeaa0bbdc822f7414
codeSamplesRevisionDigest: sha256:859080f8bc0f025db686fb068bea2903ab97b15e55d3c88ad484fe27671b7a1d
mistralai-gcp-sdk:
source: mistral-google-cloud-source
sourceNamespace: mistral-openapi-google-cloud
Expand All @@ -50,18 +50,12 @@ workflow:
mistral-azure-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
registry:
location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main
mistral-google-cloud-source:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
registry:
location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main
mistral-openapi:
inputs:
- location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
registry:
location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main
targets:
mistralai-azure-sdk:
target: typescript
Expand Down
10 changes: 5 additions & 5 deletions packages/mistralai-azure/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 01e8a40b-3df3-4d9a-9501-2eb9e0d26c05
management:
docChecksum: 0f195020b1080b5c3b1fc5834d30a929
docChecksum: 1eac78d7698423fcd3bc58124f860d30
docVersion: 0.0.2
speakeasyVersion: 1.434.7
generationVersion: 2.452.0
releaseVersion: 1.3.0
configChecksum: 55c7ae5ef7c8b3cba4660d8a57efc248
speakeasyVersion: 1.438.1
generationVersion: 2.457.2
releaseVersion: 1.3.1
configChecksum: 003b83d3c40dab3a6fbc894a958541d1
repoURL: https://github.com/mistralai/client-ts.git
repoSubDirectory: packages/mistralai-azure
installationURL: https://gitpkg.now.sh/mistralai/client-ts/packages/mistralai-azure
Expand Down
3 changes: 2 additions & 1 deletion packages/mistralai-azure/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
typescript:
version: 1.3.0
version: 1.3.1
additionalDependencies:
dependencies: {}
devDependencies: {}
peerDependencies: {}
additionalPackageJSON: {}
author: Speakeasy
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
enumFormat: union
envVarPrefix: MISTRAL
flattenGlobalSecurity: true
Expand Down
12 changes: 11 additions & 1 deletion packages/mistralai-azure/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-azure
### Releases
- [NPM v1.3.0] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.0 - packages/mistralai-azure
- [NPM v1.3.0] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.0 - packages/mistralai-azure

## 2024-11-12 18:05:05
### 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-azure
### Releases
- [NPM v1.3.1] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.1 - packages/mistralai-azure
2 changes: 1 addition & 1 deletion packages/mistralai-azure/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@mistralai/mistralai-azure",
"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-azure/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-azure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mistralai/mistralai-azure",
"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-azure/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-azure/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
2 changes: 2 additions & 0 deletions packages/mistralai-azure/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-azure/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-azure",
"speakeasy-sdk/typescript 1.3.1 2.457.2 0.0.2 @mistralai/mistralai-azure",
} as const;
7 changes: 3 additions & 4 deletions packages/mistralai-azure/src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ export interface Env {
}

export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
MISTRAL_API_KEY: z.string(),
MISTRAL_API_KEY: z.string().optional(),

MISTRAL_DEBUG: z.coerce.boolean(),
})
.partial();
MISTRAL_DEBUG: z.coerce.boolean().optional(),
});

let envMemo: Env | undefined = undefined;
/**
Expand Down
20 changes: 20 additions & 0 deletions packages/mistralai-azure/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-azure/src/lib/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
import * as components from "../models/components/index.js";
import { env } from "./env.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 @@ -38,6 +46,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 @@ -74,7 +83,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 @@ -90,6 +110,7 @@ export type SecurityInput =
| SecurityInputAPIKey
| SecurityInputOAuth2
| SecurityInputOAuth2ClientCredentials
| SecurityInputOAuth2PasswordCredentials
| SecurityInputOIDC
| SecurityInputCustom;

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

const option = options.find((opts) => {
Expand All @@ -111,6 +133,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 @@ -153,6 +181,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 @@ -180,9 +211,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 @@ -193,6 +228,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 @@ -295,8 +295,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(),
safe_prompt: z.boolean().default(false),
}).transform((v) => {
Expand Down Expand Up @@ -330,8 +330,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;
safe_prompt: boolean;
};
Expand Down Expand Up @@ -379,8 +379,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(),
safePrompt: z.boolean().default(false),
}).transform((v) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,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(),
safe_prompt: z.boolean().default(false),
}).transform((v) => {
Expand Down Expand Up @@ -323,8 +323,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;
safe_prompt: boolean;
};
Expand Down Expand Up @@ -372,8 +372,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(),
safePrompt: z.boolean().default(false),
}).transform((v) => {
Expand Down

0 comments on commit 8f86876

Please sign in to comment.