@azure-rest/ai-inference 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/README.md +429 -0
- package/dist/browser/clientDefinitions.d.ts +29 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +10 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +12 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +4 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/dist/browser/isUnexpected.js +72 -0
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/modelClient.d.ts +11 -0
- package/dist/browser/modelClient.d.ts.map +1 -0
- package/dist/browser/modelClient.js +40 -0
- package/dist/browser/modelClient.js.map +1 -0
- package/dist/browser/models.d.ts +164 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +114 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/parameters.d.ts +33 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/responses.d.ts +32 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +29 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +10 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +15 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +4 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +76 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/modelClient.d.ts +11 -0
- package/dist/commonjs/modelClient.d.ts.map +1 -0
- package/dist/commonjs/modelClient.js +43 -0
- package/dist/commonjs/modelClient.js.map +1 -0
- package/dist/commonjs/models.d.ts +164 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +114 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/parameters.d.ts +33 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/responses.d.ts +32 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/clientDefinitions.d.ts +29 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +4 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +72 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/modelClient.d.ts +11 -0
- package/dist/esm/modelClient.d.ts.map +1 -0
- package/dist/esm/modelClient.js +40 -0
- package/dist/esm/modelClient.js.map +1 -0
- package/dist/esm/models.d.ts +164 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +114 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/parameters.d.ts +33 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/responses.d.ts +32 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +29 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +10 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +12 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +4 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +72 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/modelClient.d.ts +11 -0
- package/dist/react-native/modelClient.d.ts.map +1 -0
- package/dist/react-native/modelClient.js +40 -0
- package/dist/react-native/modelClient.js.map +1 -0
- package/dist/react-native/models.d.ts +164 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +114 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/parameters.d.ts +33 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/responses.d.ts +32 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +148 -0
- package/review/ai-inference.api.md +343 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested
|
|
3
|
+
* chat completion.
|
|
4
|
+
*/
|
|
5
|
+
export interface ChatCompletionsToolCallOutputParent {
|
|
6
|
+
/** The ID of the tool call. */
|
|
7
|
+
id: string;
|
|
8
|
+
type: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A tool call to a function tool, issued by the model in evaluation of a configured function tool, that represents
|
|
12
|
+
* a function invocation needed for a subsequent chat completions request to resolve.
|
|
13
|
+
*/
|
|
14
|
+
export interface ChatCompletionsFunctionToolCallOutput extends ChatCompletionsToolCallOutputParent {
|
|
15
|
+
/** The type of tool call, in this case always 'function'. */
|
|
16
|
+
type: "function";
|
|
17
|
+
/** The details of the function invocation requested by the tool call. */
|
|
18
|
+
function: FunctionCallOutput;
|
|
19
|
+
}
|
|
20
|
+
/** The name and arguments of a function that should be called, as generated by the model. */
|
|
21
|
+
export interface FunctionCallOutput {
|
|
22
|
+
/** The name of the function to call. */
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* The arguments to call the function with, as generated by the model in JSON format.
|
|
26
|
+
* Note that the model does not always generate valid JSON, and may hallucinate parameters
|
|
27
|
+
* not defined by your function schema. Validate the arguments in your code before calling
|
|
28
|
+
* your function.
|
|
29
|
+
*/
|
|
30
|
+
arguments: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Representation of the response data from a chat completions request.
|
|
34
|
+
* Completions support a wide variety of tasks and generate text that continues from or "completes"
|
|
35
|
+
* provided prompt data.
|
|
36
|
+
*/
|
|
37
|
+
export interface ChatCompletionsOutput {
|
|
38
|
+
/** A unique identifier associated with this chat completions response. */
|
|
39
|
+
id: string;
|
|
40
|
+
/**
|
|
41
|
+
* The first timestamp associated with generation activity for this completions response,
|
|
42
|
+
* represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970.
|
|
43
|
+
*/
|
|
44
|
+
created: number;
|
|
45
|
+
/** The model used for the chat completion. */
|
|
46
|
+
model: string;
|
|
47
|
+
/** Usage information for tokens processed and generated as part of this completions operation. */
|
|
48
|
+
usage: CompletionsUsageOutput;
|
|
49
|
+
/**
|
|
50
|
+
* The collection of completions choices associated with this completions response.
|
|
51
|
+
* Generally, `n` choices are generated per provided prompt with a default value of 1.
|
|
52
|
+
* Token limits and other settings may limit the number of choices generated.
|
|
53
|
+
*/
|
|
54
|
+
choices: Array<ChatChoiceOutput>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Representation of the token counts processed for a completions request.
|
|
58
|
+
* Counts consider all tokens across prompts, choices, choice alternates, best_of generations, and
|
|
59
|
+
* other consumers.
|
|
60
|
+
*/
|
|
61
|
+
export interface CompletionsUsageOutput {
|
|
62
|
+
/** The number of tokens generated across all completions emissions. */
|
|
63
|
+
completion_tokens: number;
|
|
64
|
+
/** The number of tokens in the provided prompts for the completions request. */
|
|
65
|
+
prompt_tokens: number;
|
|
66
|
+
/** The total number of tokens processed for the completions request and response. */
|
|
67
|
+
total_tokens: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The representation of a single prompt completion as part of an overall chat completions request.
|
|
71
|
+
* Generally, `n` choices are generated per provided prompt with a default value of 1.
|
|
72
|
+
* Token limits and other settings may limit the number of choices generated.
|
|
73
|
+
*/
|
|
74
|
+
export interface ChatChoiceOutput {
|
|
75
|
+
/** The ordered index associated with this chat completions choice. */
|
|
76
|
+
index: number;
|
|
77
|
+
/** The reason that this chat completions choice completed its generated. */
|
|
78
|
+
finish_reason: CompletionsFinishReasonOutput | null;
|
|
79
|
+
/** The chat message for a given chat completions prompt. */
|
|
80
|
+
message: ChatResponseMessageOutput;
|
|
81
|
+
}
|
|
82
|
+
/** A representation of a chat message as received in a response. */
|
|
83
|
+
export interface ChatResponseMessageOutput {
|
|
84
|
+
/** The chat role associated with the message. */
|
|
85
|
+
role: ChatRoleOutput;
|
|
86
|
+
/** The content of the message. */
|
|
87
|
+
content: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat
|
|
90
|
+
* completions request to resolve as configured.
|
|
91
|
+
*/
|
|
92
|
+
tool_calls?: Array<ChatCompletionsToolCallOutput>;
|
|
93
|
+
}
|
|
94
|
+
/** Represents some basic information about the AI model. */
|
|
95
|
+
export interface ModelInfoOutput {
|
|
96
|
+
/** The name of the AI model. For example: `Phi21` */
|
|
97
|
+
model_name: string;
|
|
98
|
+
/** The type of the AI model. A Unique identifier for the profile. */
|
|
99
|
+
model_type: ModelTypeOutput;
|
|
100
|
+
/** The model provider name. For example: `Microsoft Research` */
|
|
101
|
+
model_provider_name: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested
|
|
105
|
+
* chat completion.
|
|
106
|
+
*/
|
|
107
|
+
export type ChatCompletionsToolCallOutput = ChatCompletionsToolCallOutputParent | ChatCompletionsFunctionToolCallOutput;
|
|
108
|
+
/** Alias for ChatRoleOutput */
|
|
109
|
+
export type ChatRoleOutput = string | "system" | "user" | "assistant" | "tool";
|
|
110
|
+
/** Alias for CompletionsFinishReasonOutput */
|
|
111
|
+
export type CompletionsFinishReasonOutput = string | "stop" | "length" | "content_filter" | "tool_calls";
|
|
112
|
+
/** Alias for ModelTypeOutput */
|
|
113
|
+
export type ModelTypeOutput = string | "embeddings" | "image_generation" | "text_generation" | "image_embeddings" | "audio_generation" | "chat";
|
|
114
|
+
//# sourceMappingURL=outputModels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,qCACf,SAAQ,mCAAmC;IAC3C,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;IACjB,yEAAyE;IACzE,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,6FAA6F;AAC7F,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,sBAAsB,CAAC;IAC9B;;;;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BAAkB,GAClB,kBAAkB,GAClB,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested\n * chat completion.\n */\nexport interface ChatCompletionsToolCallOutputParent {\n /** The ID of the tool call. */\n id: string;\n type: string;\n}\n\n/**\n * A tool call to a function tool, issued by the model in evaluation of a configured function tool, that represents\n * a function invocation needed for a subsequent chat completions request to resolve.\n */\nexport interface ChatCompletionsFunctionToolCallOutput\n extends ChatCompletionsToolCallOutputParent {\n /** The type of tool call, in this case always 'function'. */\n type: \"function\";\n /** The details of the function invocation requested by the tool call. */\n function: FunctionCallOutput;\n}\n\n/** The name and arguments of a function that should be called, as generated by the model. */\nexport interface FunctionCallOutput {\n /** The name of the function to call. */\n name: string;\n /**\n * The arguments to call the function with, as generated by the model in JSON format.\n * Note that the model does not always generate valid JSON, and may hallucinate parameters\n * not defined by your function schema. Validate the arguments in your code before calling\n * your function.\n */\n arguments: string;\n}\n\n/**\n * Representation of the response data from a chat completions request.\n * Completions support a wide variety of tasks and generate text that continues from or \"completes\"\n * provided prompt data.\n */\nexport interface ChatCompletionsOutput {\n /** A unique identifier associated with this chat completions response. */\n id: string;\n /**\n * The first timestamp associated with generation activity for this completions response,\n * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970.\n */\n created: number;\n /** The model used for the chat completion. */\n model: string;\n /** Usage information for tokens processed and generated as part of this completions operation. */\n usage: CompletionsUsageOutput;\n /**\n * The collection of completions choices associated with this completions response.\n * Generally, `n` choices are generated per provided prompt with a default value of 1.\n * Token limits and other settings may limit the number of choices generated.\n */\n choices: Array<ChatChoiceOutput>;\n}\n\n/**\n * Representation of the token counts processed for a completions request.\n * Counts consider all tokens across prompts, choices, choice alternates, best_of generations, and\n * other consumers.\n */\nexport interface CompletionsUsageOutput {\n /** The number of tokens generated across all completions emissions. */\n completion_tokens: number;\n /** The number of tokens in the provided prompts for the completions request. */\n prompt_tokens: number;\n /** The total number of tokens processed for the completions request and response. */\n total_tokens: number;\n}\n\n/**\n * The representation of a single prompt completion as part of an overall chat completions request.\n * Generally, `n` choices are generated per provided prompt with a default value of 1.\n * Token limits and other settings may limit the number of choices generated.\n */\nexport interface ChatChoiceOutput {\n /** The ordered index associated with this chat completions choice. */\n index: number;\n /** The reason that this chat completions choice completed its generated. */\n finish_reason: CompletionsFinishReasonOutput | null;\n /** The chat message for a given chat completions prompt. */\n message: ChatResponseMessageOutput;\n}\n\n/** A representation of a chat message as received in a response. */\nexport interface ChatResponseMessageOutput {\n /** The chat role associated with the message. */\n role: ChatRoleOutput;\n /** The content of the message. */\n content: string | null;\n /**\n * The tool calls that must be resolved and have their outputs appended to subsequent input messages for the chat\n * completions request to resolve as configured.\n */\n tool_calls?: Array<ChatCompletionsToolCallOutput>;\n}\n\n/** Represents some basic information about the AI model. */\nexport interface ModelInfoOutput {\n /** The name of the AI model. For example: `Phi21` */\n model_name: string;\n /** The type of the AI model. A Unique identifier for the profile. */\n model_type: ModelTypeOutput;\n /** The model provider name. For example: `Microsoft Research` */\n model_provider_name: string;\n}\n\n/**\n * An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested\n * chat completion.\n */\nexport type ChatCompletionsToolCallOutput =\n | ChatCompletionsToolCallOutputParent\n | ChatCompletionsFunctionToolCallOutput;\n/** Alias for ChatRoleOutput */\nexport type ChatRoleOutput = string | \"system\" | \"user\" | \"assistant\" | \"tool\";\n/** Alias for CompletionsFinishReasonOutput */\nexport type CompletionsFinishReasonOutput =\n | string\n | \"stop\"\n | \"length\"\n | \"content_filter\"\n | \"tool_calls\";\n/** Alias for ModelTypeOutput */\nexport type ModelTypeOutput =\n | string\n | \"embeddings\"\n | \"image_generation\"\n | \"text_generation\"\n | \"image_embeddings\"\n | \"audio_generation\"\n | \"chat\";\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
|
|
2
|
+
import { RequestParameters } from "@azure-rest/core-client";
|
|
3
|
+
import { UnknownParams, ChatRequestMessage, ChatCompletionsResponseFormat, ChatCompletionsToolDefinition, ChatCompletionsToolSelectionPreset, ChatCompletionsNamedToolSelection } from "./models.js";
|
|
4
|
+
export interface GetChatCompletionsHeaders {
|
|
5
|
+
/**
|
|
6
|
+
* Controls what happens if unknown parameters are passed in the JSON request payload.
|
|
7
|
+
* This sets the HTTP request header `unknown-parameters`.
|
|
8
|
+
*/
|
|
9
|
+
"unknown-parameters"?: UnknownParams;
|
|
10
|
+
}
|
|
11
|
+
export interface GetChatCompletionsBodyParam {
|
|
12
|
+
body?: {
|
|
13
|
+
messages: Array<ChatRequestMessage>;
|
|
14
|
+
frequency_penalty?: number;
|
|
15
|
+
stream?: boolean;
|
|
16
|
+
presence_penalty?: number;
|
|
17
|
+
temperature?: number;
|
|
18
|
+
top_p?: number;
|
|
19
|
+
max_tokens?: number;
|
|
20
|
+
response_format?: ChatCompletionsResponseFormat;
|
|
21
|
+
stop?: string[];
|
|
22
|
+
tools?: Array<ChatCompletionsToolDefinition>;
|
|
23
|
+
tool_choice?: ChatCompletionsToolSelectionPreset | ChatCompletionsNamedToolSelection;
|
|
24
|
+
seed?: number;
|
|
25
|
+
model?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface GetChatCompletionsHeaderParam {
|
|
29
|
+
headers?: RawHttpHeadersInput & GetChatCompletionsHeaders;
|
|
30
|
+
}
|
|
31
|
+
export type GetChatCompletionsParameters = GetChatCompletionsHeaderParam & GetChatCompletionsBodyParam & RequestParameters;
|
|
32
|
+
export type GetModelInfoParameters = RequestParameters;
|
|
33
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport {\n UnknownParams,\n ChatRequestMessage,\n ChatCompletionsResponseFormat,\n ChatCompletionsToolDefinition,\n ChatCompletionsToolSelectionPreset,\n ChatCompletionsNamedToolSelection,\n} from \"./models.js\";\n\nexport interface GetChatCompletionsHeaders {\n /**\n * Controls what happens if unknown parameters are passed in the JSON request payload.\n * This sets the HTTP request header `unknown-parameters`.\n */\n \"unknown-parameters\"?: UnknownParams;\n}\n\nexport interface GetChatCompletionsBodyParam {\n body?: {\n messages: Array<ChatRequestMessage>;\n frequency_penalty?: number;\n stream?: boolean;\n presence_penalty?: number;\n temperature?: number;\n top_p?: number;\n max_tokens?: number;\n response_format?: ChatCompletionsResponseFormat;\n stop?: string[];\n tools?: Array<ChatCompletionsToolDefinition>;\n tool_choice?:\n | ChatCompletionsToolSelectionPreset\n | ChatCompletionsNamedToolSelection;\n seed?: number;\n model?: string;\n };\n}\n\nexport interface GetChatCompletionsHeaderParam {\n headers?: RawHttpHeadersInput & GetChatCompletionsHeaders;\n}\n\nexport type GetChatCompletionsParameters = GetChatCompletionsHeaderParam &\n GetChatCompletionsBodyParam &\n RequestParameters;\nexport type GetModelInfoParameters = RequestParameters;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RawHttpHeaders } from "@azure/core-rest-pipeline";
|
|
2
|
+
import { HttpResponse, ErrorResponse } from "@azure-rest/core-client";
|
|
3
|
+
import { ChatCompletionsOutput, ModelInfoOutput } from "./outputModels.js";
|
|
4
|
+
/** The request has succeeded. */
|
|
5
|
+
export interface GetChatCompletions200Response extends HttpResponse {
|
|
6
|
+
status: "200";
|
|
7
|
+
body: ChatCompletionsOutput;
|
|
8
|
+
}
|
|
9
|
+
export interface GetChatCompletionsDefaultHeaders {
|
|
10
|
+
/** String error code indicating what went wrong. */
|
|
11
|
+
"x-ms-error-code"?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetChatCompletionsDefaultResponse extends HttpResponse {
|
|
14
|
+
status: string;
|
|
15
|
+
body: ErrorResponse;
|
|
16
|
+
headers: RawHttpHeaders & GetChatCompletionsDefaultHeaders;
|
|
17
|
+
}
|
|
18
|
+
/** The request has succeeded. */
|
|
19
|
+
export interface GetModelInfo200Response extends HttpResponse {
|
|
20
|
+
status: "200";
|
|
21
|
+
body: ModelInfoOutput;
|
|
22
|
+
}
|
|
23
|
+
export interface GetModelInfoDefaultHeaders {
|
|
24
|
+
/** String error code indicating what went wrong. */
|
|
25
|
+
"x-ms-error-code"?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GetModelInfoDefaultResponse extends HttpResponse {
|
|
28
|
+
status: string;
|
|
29
|
+
body: ErrorResponse;
|
|
30
|
+
headers: RawHttpHeaders & GetModelInfoDefaultHeaders;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE3E,iCAAiC;AACjC,MAAM,WAAW,6BAA8B,SAAQ,YAAY;IACjE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,qBAAqB,CAAC;CAC7B;AAED,MAAM,WAAW,gCAAgC;IAC/C,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,cAAc,GAAG,gCAAgC,CAAC;CAC5D;AAED,iCAAiC;AACjC,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,cAAc,GAAG,0BAA0B,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport { ChatCompletionsOutput, ModelInfoOutput } from \"./outputModels.js\";\n\n/** The request has succeeded. */\nexport interface GetChatCompletions200Response extends HttpResponse {\n status: \"200\";\n body: ChatCompletionsOutput;\n}\n\nexport interface GetChatCompletionsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetChatCompletionsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetChatCompletionsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetModelInfo200Response extends HttpResponse {\n status: \"200\";\n body: ModelInfoOutput;\n}\n\nexport interface GetModelInfoDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetModelInfoDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetModelInfoDefaultHeaders;\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@azure-rest/ai-inference",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "Inference API for Azure-supported AI models",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./package.json": "./package.json",
|
|
7
|
+
".": {
|
|
8
|
+
"browser": {
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": "./dist/browser/index.d.ts",
|
|
11
|
+
"default": "./dist/browser/index.js"
|
|
12
|
+
},
|
|
13
|
+
"react-native": {
|
|
14
|
+
"source": "./src/index.ts",
|
|
15
|
+
"types": "./dist/react-native/index.d.ts",
|
|
16
|
+
"default": "./dist/react-native/index.js"
|
|
17
|
+
},
|
|
18
|
+
"import": {
|
|
19
|
+
"source": "./src/index.ts",
|
|
20
|
+
"types": "./dist/esm/index.d.ts",
|
|
21
|
+
"default": "./dist/esm/index.js"
|
|
22
|
+
},
|
|
23
|
+
"require": {
|
|
24
|
+
"source": "./src/index.ts",
|
|
25
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
26
|
+
"default": "./dist/commonjs/index.js"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"main": "./dist/commonjs/index.js",
|
|
31
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
32
|
+
"tshy": {
|
|
33
|
+
"exports": {
|
|
34
|
+
"./package.json": "./package.json",
|
|
35
|
+
".": "./src/index.ts"
|
|
36
|
+
},
|
|
37
|
+
"dialects": [
|
|
38
|
+
"esm",
|
|
39
|
+
"commonjs"
|
|
40
|
+
],
|
|
41
|
+
"esmDialects": [
|
|
42
|
+
"browser",
|
|
43
|
+
"react-native"
|
|
44
|
+
],
|
|
45
|
+
"selfLink": false
|
|
46
|
+
},
|
|
47
|
+
"type": "module",
|
|
48
|
+
"files": [
|
|
49
|
+
"dist/",
|
|
50
|
+
"dist/esm/",
|
|
51
|
+
"/dist/commonjs/index.d.ts",
|
|
52
|
+
"README.md",
|
|
53
|
+
"CHANGELOG.md",
|
|
54
|
+
"LICENSE",
|
|
55
|
+
"review/*"
|
|
56
|
+
],
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18.0.0"
|
|
59
|
+
},
|
|
60
|
+
"sideEffects": false,
|
|
61
|
+
"autoPublish": false,
|
|
62
|
+
"keywords": [
|
|
63
|
+
"node",
|
|
64
|
+
"azure",
|
|
65
|
+
"cloud",
|
|
66
|
+
"typescript",
|
|
67
|
+
"browser",
|
|
68
|
+
"isomorphic"
|
|
69
|
+
],
|
|
70
|
+
"author": "Microsoft Corporation",
|
|
71
|
+
"license": "MIT",
|
|
72
|
+
"sdk-type": "client",
|
|
73
|
+
"repository": "github:Azure/azure-sdk-for-js",
|
|
74
|
+
"bugs": {
|
|
75
|
+
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
76
|
+
},
|
|
77
|
+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-inference-rest/README.md",
|
|
78
|
+
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
|
|
79
|
+
"//metadata": {
|
|
80
|
+
"constantPaths": [
|
|
81
|
+
{
|
|
82
|
+
"path": "src/modelClient.ts",
|
|
83
|
+
"prefix": "package-version"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"@azure-rest/core-client": "^2.1.0",
|
|
89
|
+
"@azure/abort-controller": "^1.0.0",
|
|
90
|
+
"@azure/core-auth": "^1.7.2",
|
|
91
|
+
"@azure/core-lro": "^2.6.0",
|
|
92
|
+
"@azure/core-rest-pipeline": "^1.14.0",
|
|
93
|
+
"@azure/logger": "^1.0.0",
|
|
94
|
+
"tslib": "^2.6.2"
|
|
95
|
+
},
|
|
96
|
+
"devDependencies": {
|
|
97
|
+
"@azure-tools/test-credential": "^1.1.0",
|
|
98
|
+
"@azure-tools/test-recorder": "^4.0.0",
|
|
99
|
+
"@azure/core-sse": "^2.1.3",
|
|
100
|
+
"@azure/core-util": "^1.9.0",
|
|
101
|
+
"@azure/dev-tool": "^1.0.0",
|
|
102
|
+
"@azure/identity": "^4.3.0",
|
|
103
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
104
|
+
"@types/node": "^18.0.0",
|
|
105
|
+
"@vitest/browser": "^1.3.1",
|
|
106
|
+
"@vitest/coverage-istanbul": "^1.3.1",
|
|
107
|
+
"autorest": "latest",
|
|
108
|
+
"cross-env": "7.0.3",
|
|
109
|
+
"dotenv": "^16.4.5",
|
|
110
|
+
"mkdirp": "^3.0.1",
|
|
111
|
+
"playwright": "^1.41.2",
|
|
112
|
+
"rimraf": "^5.0.5",
|
|
113
|
+
"source-map-support": "^0.5.9",
|
|
114
|
+
"tshy": "^1.11.1",
|
|
115
|
+
"typescript": "~5.4.5",
|
|
116
|
+
"vitest": "^1.3.1"
|
|
117
|
+
},
|
|
118
|
+
"scripts": {
|
|
119
|
+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
|
120
|
+
"build:samples": "echo Obsolete",
|
|
121
|
+
"generate": "tsp-client update",
|
|
122
|
+
"check-format": "echo skipped",
|
|
123
|
+
"clean": "rimraf --glob dist dist-* test-dist temp types *.tgz *.log",
|
|
124
|
+
"execute:samples": "dev-tool samples run samples-dev",
|
|
125
|
+
"extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api",
|
|
126
|
+
"format": "echo skipped",
|
|
127
|
+
"integration-test:browser": "npm run unit-test:browser",
|
|
128
|
+
"integration-test:node": "echo skipped",
|
|
129
|
+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
130
|
+
"lint:fix": "echo skipped",
|
|
131
|
+
"lint": "echo skipped",
|
|
132
|
+
"pack": "npm pack 2>&1",
|
|
133
|
+
"test:browser": "npm run clean && npm run unit-test:browser && npm run integration-test:browser",
|
|
134
|
+
"unit-test:browser": "npm run clean && dev-tool run build-test && dev-tool run test:vitest --browser --hookTimeout=50000",
|
|
135
|
+
"unit-test:node": "dev-tool run test:vitest --hookTimeout=50000",
|
|
136
|
+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
137
|
+
"build:test": "npm run clean && tshy && dev-tool run build-test",
|
|
138
|
+
"build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api",
|
|
139
|
+
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
|
|
140
|
+
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test"
|
|
141
|
+
},
|
|
142
|
+
"//sampleConfiguration": {
|
|
143
|
+
"productName": "Azure AI Inference",
|
|
144
|
+
"productSlugs": [
|
|
145
|
+
"azure"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|