@azure-rest/ai-inference 1.0.0-beta.1 → 1.0.0-beta.2

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.
Files changed (97) hide show
  1. package/README.md +42 -0
  2. package/dist/browser/clientDefinitions.d.ts +20 -2
  3. package/dist/browser/clientDefinitions.d.ts.map +1 -1
  4. package/dist/browser/clientDefinitions.js.map +1 -1
  5. package/dist/browser/isUnexpected.d.ts +3 -1
  6. package/dist/browser/isUnexpected.d.ts.map +1 -1
  7. package/dist/browser/isUnexpected.js +2 -0
  8. package/dist/browser/isUnexpected.js.map +1 -1
  9. package/dist/browser/modelClient.d.ts +6 -1
  10. package/dist/browser/modelClient.d.ts.map +1 -1
  11. package/dist/browser/modelClient.js +19 -5
  12. package/dist/browser/modelClient.js.map +1 -1
  13. package/dist/browser/models.d.ts +19 -5
  14. package/dist/browser/models.d.ts.map +1 -1
  15. package/dist/browser/models.js.map +1 -1
  16. package/dist/browser/outputModels.d.ts +38 -3
  17. package/dist/browser/outputModels.d.ts.map +1 -1
  18. package/dist/browser/outputModels.js.map +1 -1
  19. package/dist/browser/parameters.d.ts +47 -4
  20. package/dist/browser/parameters.d.ts.map +1 -1
  21. package/dist/browser/parameters.js.map +1 -1
  22. package/dist/browser/responses.d.ts +29 -1
  23. package/dist/browser/responses.d.ts.map +1 -1
  24. package/dist/browser/responses.js.map +1 -1
  25. package/dist/commonjs/clientDefinitions.d.ts +20 -2
  26. package/dist/commonjs/clientDefinitions.d.ts.map +1 -1
  27. package/dist/commonjs/clientDefinitions.js.map +1 -1
  28. package/dist/commonjs/isUnexpected.d.ts +3 -1
  29. package/dist/commonjs/isUnexpected.d.ts.map +1 -1
  30. package/dist/commonjs/isUnexpected.js +3 -2
  31. package/dist/commonjs/isUnexpected.js.map +1 -1
  32. package/dist/commonjs/modelClient.d.ts +6 -1
  33. package/dist/commonjs/modelClient.d.ts.map +1 -1
  34. package/dist/commonjs/modelClient.js +20 -6
  35. package/dist/commonjs/modelClient.js.map +1 -1
  36. package/dist/commonjs/models.d.ts +19 -5
  37. package/dist/commonjs/models.d.ts.map +1 -1
  38. package/dist/commonjs/models.js.map +1 -1
  39. package/dist/commonjs/outputModels.d.ts +38 -3
  40. package/dist/commonjs/outputModels.d.ts.map +1 -1
  41. package/dist/commonjs/outputModels.js.map +1 -1
  42. package/dist/commonjs/parameters.d.ts +47 -4
  43. package/dist/commonjs/parameters.d.ts.map +1 -1
  44. package/dist/commonjs/parameters.js.map +1 -1
  45. package/dist/commonjs/responses.d.ts +29 -1
  46. package/dist/commonjs/responses.d.ts.map +1 -1
  47. package/dist/commonjs/responses.js.map +1 -1
  48. package/dist/commonjs/tsdoc-metadata.json +1 -1
  49. package/dist/esm/clientDefinitions.d.ts +20 -2
  50. package/dist/esm/clientDefinitions.d.ts.map +1 -1
  51. package/dist/esm/clientDefinitions.js.map +1 -1
  52. package/dist/esm/isUnexpected.d.ts +3 -1
  53. package/dist/esm/isUnexpected.d.ts.map +1 -1
  54. package/dist/esm/isUnexpected.js +2 -0
  55. package/dist/esm/isUnexpected.js.map +1 -1
  56. package/dist/esm/modelClient.d.ts +6 -1
  57. package/dist/esm/modelClient.d.ts.map +1 -1
  58. package/dist/esm/modelClient.js +19 -5
  59. package/dist/esm/modelClient.js.map +1 -1
  60. package/dist/esm/models.d.ts +19 -5
  61. package/dist/esm/models.d.ts.map +1 -1
  62. package/dist/esm/models.js.map +1 -1
  63. package/dist/esm/outputModels.d.ts +38 -3
  64. package/dist/esm/outputModels.d.ts.map +1 -1
  65. package/dist/esm/outputModels.js.map +1 -1
  66. package/dist/esm/parameters.d.ts +47 -4
  67. package/dist/esm/parameters.d.ts.map +1 -1
  68. package/dist/esm/parameters.js.map +1 -1
  69. package/dist/esm/responses.d.ts +29 -1
  70. package/dist/esm/responses.d.ts.map +1 -1
  71. package/dist/esm/responses.js.map +1 -1
  72. package/dist/react-native/clientDefinitions.d.ts +20 -2
  73. package/dist/react-native/clientDefinitions.d.ts.map +1 -1
  74. package/dist/react-native/clientDefinitions.js.map +1 -1
  75. package/dist/react-native/isUnexpected.d.ts +3 -1
  76. package/dist/react-native/isUnexpected.d.ts.map +1 -1
  77. package/dist/react-native/isUnexpected.js +2 -0
  78. package/dist/react-native/isUnexpected.js.map +1 -1
  79. package/dist/react-native/modelClient.d.ts +6 -1
  80. package/dist/react-native/modelClient.d.ts.map +1 -1
  81. package/dist/react-native/modelClient.js +19 -5
  82. package/dist/react-native/modelClient.js.map +1 -1
  83. package/dist/react-native/models.d.ts +19 -5
  84. package/dist/react-native/models.d.ts.map +1 -1
  85. package/dist/react-native/models.js.map +1 -1
  86. package/dist/react-native/outputModels.d.ts +38 -3
  87. package/dist/react-native/outputModels.d.ts.map +1 -1
  88. package/dist/react-native/outputModels.js.map +1 -1
  89. package/dist/react-native/parameters.d.ts +47 -4
  90. package/dist/react-native/parameters.d.ts.map +1 -1
  91. package/dist/react-native/parameters.js.map +1 -1
  92. package/dist/react-native/responses.d.ts +29 -1
  93. package/dist/react-native/responses.d.ts.map +1 -1
  94. package/dist/react-native/responses.js.map +1 -1
  95. package/package.json +6 -9
  96. package/CHANGELOG.md +0 -6
  97. package/review/ai-inference.api.md +0 -343
@@ -1 +1 @@
1
- {"version":3,"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"]}
1
+ {"version":3,"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 ExtraParameters,\n ChatRequestMessage,\n ChatCompletionsResponseFormat,\n ChatCompletionsToolDefinition,\n ChatCompletionsToolSelectionPreset,\n ChatCompletionsNamedToolSelection,\n EmbeddingEncodingFormat,\n EmbeddingInputType,\n ImageEmbeddingInput,\n} from \"./models.js\";\n\nexport interface GetChatCompletionsHeaders {\n /**\n * Controls what happens if extra parameters, undefined by the REST API,\n * are passed in the JSON request payload.\n * This sets the HTTP request header `extra-parameters`.\n */\n \"extra-parameters\"?: ExtraParameters;\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\nexport interface GetEmbeddingsHeaders {\n /**\n * Controls what happens if extra parameters, undefined by the REST API,\n * are passed in the JSON request payload.\n * This sets the HTTP request header `extra-parameters`.\n */\n \"extra-parameters\"?: ExtraParameters;\n}\n\nexport interface GetEmbeddingsBodyParam {\n body?: {\n input: string[];\n dimensions?: number;\n encoding_format?: EmbeddingEncodingFormat;\n input_type?: EmbeddingInputType;\n model?: string;\n };\n}\n\nexport interface GetEmbeddingsHeaderParam {\n headers?: RawHttpHeadersInput & GetEmbeddingsHeaders;\n}\n\nexport type GetEmbeddingsParameters = GetEmbeddingsHeaderParam &\n GetEmbeddingsBodyParam &\n RequestParameters;\n\nexport interface GetImageEmbeddingsHeaders {\n /**\n * Controls what happens if extra parameters, undefined by the REST API,\n * are passed in the JSON request payload.\n * This sets the HTTP request header `extra-parameters`.\n */\n \"extra-parameters\"?: ExtraParameters;\n}\n\nexport interface GetImageEmbeddingsBodyParam {\n body?: {\n input: Array<ImageEmbeddingInput>;\n dimensions?: number;\n encoding_format?: EmbeddingEncodingFormat;\n input_type?: EmbeddingInputType;\n model?: string;\n };\n}\n\nexport interface GetImageEmbeddingsHeaderParam {\n headers?: RawHttpHeadersInput & GetImageEmbeddingsHeaders;\n}\n\nexport type GetImageEmbeddingsParameters = GetImageEmbeddingsHeaderParam &\n GetImageEmbeddingsBodyParam &\n RequestParameters;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { RawHttpHeaders } from "@azure/core-rest-pipeline";
2
2
  import { HttpResponse, ErrorResponse } from "@azure-rest/core-client";
3
- import { ChatCompletionsOutput, ModelInfoOutput } from "./outputModels.js";
3
+ import { ChatCompletionsOutput, ModelInfoOutput, EmbeddingsResultOutput } from "./outputModels.js";
4
4
  /** The request has succeeded. */
5
5
  export interface GetChatCompletions200Response extends HttpResponse {
6
6
  status: "200";
@@ -29,4 +29,32 @@ export interface GetModelInfoDefaultResponse extends HttpResponse {
29
29
  body: ErrorResponse;
30
30
  headers: RawHttpHeaders & GetModelInfoDefaultHeaders;
31
31
  }
32
+ /** The request has succeeded. */
33
+ export interface GetEmbeddings200Response extends HttpResponse {
34
+ status: "200";
35
+ body: EmbeddingsResultOutput;
36
+ }
37
+ export interface GetEmbeddingsDefaultHeaders {
38
+ /** String error code indicating what went wrong. */
39
+ "x-ms-error-code"?: string;
40
+ }
41
+ export interface GetEmbeddingsDefaultResponse extends HttpResponse {
42
+ status: string;
43
+ body: ErrorResponse;
44
+ headers: RawHttpHeaders & GetEmbeddingsDefaultHeaders;
45
+ }
46
+ /** The request has succeeded. */
47
+ export interface GetImageEmbeddings200Response extends HttpResponse {
48
+ status: "200";
49
+ body: EmbeddingsResultOutput;
50
+ }
51
+ export interface GetImageEmbeddingsDefaultHeaders {
52
+ /** String error code indicating what went wrong. */
53
+ "x-ms-error-code"?: string;
54
+ }
55
+ export interface GetImageEmbeddingsDefaultResponse extends HttpResponse {
56
+ status: string;
57
+ body: ErrorResponse;
58
+ headers: RawHttpHeaders & GetImageEmbeddingsDefaultHeaders;
59
+ }
32
60
  //# sourceMappingURL=responses.d.ts.map
@@ -1 +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,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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"]}
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 {\n ChatCompletionsOutput,\n ModelInfoOutput,\n EmbeddingsResultOutput,\n} 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\n/** The request has succeeded. */\nexport interface GetEmbeddings200Response extends HttpResponse {\n status: \"200\";\n body: EmbeddingsResultOutput;\n}\n\nexport interface GetEmbeddingsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetEmbeddingsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetEmbeddingsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface GetImageEmbeddings200Response extends HttpResponse {\n status: \"200\";\n body: EmbeddingsResultOutput;\n}\n\nexport interface GetImageEmbeddingsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetImageEmbeddingsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetImageEmbeddingsDefaultHeaders;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.0"
8
+ "packageVersion": "7.47.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,5 +1,5 @@
1
- import { GetChatCompletionsParameters, GetModelInfoParameters } from "./parameters.js";
2
- import { GetChatCompletions200Response, GetChatCompletionsDefaultResponse, GetModelInfo200Response, GetModelInfoDefaultResponse } from "./responses.js";
1
+ import { GetChatCompletionsParameters, GetModelInfoParameters, GetEmbeddingsParameters, GetImageEmbeddingsParameters } from "./parameters.js";
2
+ import { GetChatCompletions200Response, GetChatCompletionsDefaultResponse, GetModelInfo200Response, GetModelInfoDefaultResponse, GetEmbeddings200Response, GetEmbeddingsDefaultResponse, GetImageEmbeddings200Response, GetImageEmbeddingsDefaultResponse } from "./responses.js";
3
3
  import { Client, StreamableMethod } from "@azure-rest/core-client";
4
4
  export interface GetChatCompletions {
5
5
  /**
@@ -17,11 +17,29 @@ export interface GetModelInfo {
17
17
  */
18
18
  get(options?: GetModelInfoParameters): StreamableMethod<GetModelInfo200Response | GetModelInfoDefaultResponse>;
19
19
  }
20
+ export interface GetEmbeddings {
21
+ /**
22
+ * Return the embedding vectors for given text prompts.
23
+ * The method makes a REST API call to the `/embeddings` route on the given endpoint.
24
+ */
25
+ post(options?: GetEmbeddingsParameters): StreamableMethod<GetEmbeddings200Response | GetEmbeddingsDefaultResponse>;
26
+ }
27
+ export interface GetImageEmbeddings {
28
+ /**
29
+ * Return the embedding vectors for given images.
30
+ * The method makes a REST API call to the `/images/embeddings` route on the given endpoint.
31
+ */
32
+ post(options?: GetImageEmbeddingsParameters): StreamableMethod<GetImageEmbeddings200Response | GetImageEmbeddingsDefaultResponse>;
33
+ }
20
34
  export interface Routes {
21
35
  /** Resource for '/chat/completions' has methods for the following verbs: post */
22
36
  (path: "/chat/completions"): GetChatCompletions;
23
37
  /** Resource for '/info' has methods for the following verbs: get */
24
38
  (path: "/info"): GetModelInfo;
39
+ /** Resource for '/embeddings' has methods for the following verbs: post */
40
+ (path: "/embeddings"): GetEmbeddings;
41
+ /** Resource for '/images/embeddings' has methods for the following verbs: post */
42
+ (path: "/images/embeddings"): GetImageEmbeddings;
25
43
  }
26
44
  export type ModelClient = Client & {
27
45
  path: Routes;
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,IAAI,CACF,OAAO,CAAC,EAAE,4BAA4B,GACrC,gBAAgB,CACjB,6BAA6B,GAAG,iCAAiC,CAClE,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,sBAAsB,GAC/B,gBAAgB,CAAC,uBAAuB,GAAG,2BAA2B,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,MAAM;IACrB,iFAAiF;IACjF,CAAC,IAAI,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,oEAAoE;IACpE,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAAC;CAC/B;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
1
+ {"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EAClC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,IAAI,CACF,OAAO,CAAC,EAAE,4BAA4B,GACrC,gBAAgB,CACjB,6BAA6B,GAAG,iCAAiC,CAClE,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,GAAG,CACD,OAAO,CAAC,EAAE,sBAAsB,GAC/B,gBAAgB,CAAC,uBAAuB,GAAG,2BAA2B,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,IAAI,CACF,OAAO,CAAC,EAAE,uBAAuB,GAChC,gBAAgB,CAAC,wBAAwB,GAAG,4BAA4B,CAAC,CAAC;CAC9E;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,CACF,OAAO,CAAC,EAAE,4BAA4B,GACrC,gBAAgB,CACjB,6BAA6B,GAAG,iCAAiC,CAClE,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,iFAAiF;IACjF,CAAC,IAAI,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,oEAAoE;IACpE,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAAC;IAC9B,2EAA2E;IAC3E,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,CAAC;IACrC,kFAAkF;IAClF,CAAC,IAAI,EAAE,oBAAoB,GAAG,kBAAkB,CAAC;CAClD;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n GetChatCompletionsParameters,\n GetModelInfoParameters,\n} from \"./parameters.js\";\nimport {\n GetChatCompletions200Response,\n GetChatCompletionsDefaultResponse,\n GetModelInfo200Response,\n GetModelInfoDefaultResponse,\n} from \"./responses.js\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetChatCompletions {\n /**\n * Gets chat completions for the provided chat messages.\n * Completions support a wide variety of tasks and generate text that continues from or \"completes\"\n * provided prompt data. The method makes a REST API call to the `/chat/completions` route\n * on the given endpoint.\n */\n post(\n options?: GetChatCompletionsParameters,\n ): StreamableMethod<\n GetChatCompletions200Response | GetChatCompletionsDefaultResponse\n >;\n}\n\nexport interface GetModelInfo {\n /**\n * Returns information about the AI model.\n * The method makes a REST API call to the `/info` route on the given endpoint.\n */\n get(\n options?: GetModelInfoParameters,\n ): StreamableMethod<GetModelInfo200Response | GetModelInfoDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/chat/completions' has methods for the following verbs: post */\n (path: \"/chat/completions\"): GetChatCompletions;\n /** Resource for '/info' has methods for the following verbs: get */\n (path: \"/info\"): GetModelInfo;\n}\n\nexport type ModelClient = Client & {\n path: Routes;\n};\n"]}
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n GetChatCompletionsParameters,\n GetModelInfoParameters,\n GetEmbeddingsParameters,\n GetImageEmbeddingsParameters,\n} from \"./parameters.js\";\nimport {\n GetChatCompletions200Response,\n GetChatCompletionsDefaultResponse,\n GetModelInfo200Response,\n GetModelInfoDefaultResponse,\n GetEmbeddings200Response,\n GetEmbeddingsDefaultResponse,\n GetImageEmbeddings200Response,\n GetImageEmbeddingsDefaultResponse,\n} from \"./responses.js\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetChatCompletions {\n /**\n * Gets chat completions for the provided chat messages.\n * Completions support a wide variety of tasks and generate text that continues from or \"completes\"\n * provided prompt data. The method makes a REST API call to the `/chat/completions` route\n * on the given endpoint.\n */\n post(\n options?: GetChatCompletionsParameters,\n ): StreamableMethod<\n GetChatCompletions200Response | GetChatCompletionsDefaultResponse\n >;\n}\n\nexport interface GetModelInfo {\n /**\n * Returns information about the AI model.\n * The method makes a REST API call to the `/info` route on the given endpoint.\n */\n get(\n options?: GetModelInfoParameters,\n ): StreamableMethod<GetModelInfo200Response | GetModelInfoDefaultResponse>;\n}\n\nexport interface GetEmbeddings {\n /**\n * Return the embedding vectors for given text prompts.\n * The method makes a REST API call to the `/embeddings` route on the given endpoint.\n */\n post(\n options?: GetEmbeddingsParameters,\n ): StreamableMethod<GetEmbeddings200Response | GetEmbeddingsDefaultResponse>;\n}\n\nexport interface GetImageEmbeddings {\n /**\n * Return the embedding vectors for given images.\n * The method makes a REST API call to the `/images/embeddings` route on the given endpoint.\n */\n post(\n options?: GetImageEmbeddingsParameters,\n ): StreamableMethod<\n GetImageEmbeddings200Response | GetImageEmbeddingsDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/chat/completions' has methods for the following verbs: post */\n (path: \"/chat/completions\"): GetChatCompletions;\n /** Resource for '/info' has methods for the following verbs: get */\n (path: \"/info\"): GetModelInfo;\n /** Resource for '/embeddings' has methods for the following verbs: post */\n (path: \"/embeddings\"): GetEmbeddings;\n /** Resource for '/images/embeddings' has methods for the following verbs: post */\n (path: \"/images/embeddings\"): GetImageEmbeddings;\n}\n\nexport type ModelClient = Client & {\n path: Routes;\n};\n"]}
@@ -1,4 +1,6 @@
1
- import { GetChatCompletions200Response, GetChatCompletionsDefaultResponse, GetModelInfo200Response, GetModelInfoDefaultResponse } from "./responses.js";
1
+ import { GetChatCompletions200Response, GetChatCompletionsDefaultResponse, GetModelInfo200Response, GetModelInfoDefaultResponse, GetEmbeddings200Response, GetEmbeddingsDefaultResponse, GetImageEmbeddings200Response, GetImageEmbeddingsDefaultResponse } from "./responses.js";
2
2
  export declare function isUnexpected(response: GetChatCompletions200Response | GetChatCompletionsDefaultResponse): response is GetChatCompletionsDefaultResponse;
3
3
  export declare function isUnexpected(response: GetModelInfo200Response | GetModelInfoDefaultResponse): response is GetModelInfoDefaultResponse;
4
+ export declare function isUnexpected(response: GetEmbeddings200Response | GetEmbeddingsDefaultResponse): response is GetEmbeddingsDefaultResponse;
5
+ export declare function isUnexpected(response: GetImageEmbeddings200Response | GetImageEmbeddingsDefaultResponse): response is GetImageEmbeddingsDefaultResponse;
4
6
  //# sourceMappingURL=isUnexpected.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAOxB,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,6BAA6B,GAAG,iCAAiC,GAC1E,QAAQ,IAAI,iCAAiC,CAAC;AACjD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,uBAAuB,GAAG,2BAA2B,GAC9D,QAAQ,IAAI,2BAA2B,CAAC"}
1
+ {"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EAClC,MAAM,gBAAgB,CAAC;AASxB,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,6BAA6B,GAAG,iCAAiC,GAC1E,QAAQ,IAAI,iCAAiC,CAAC;AACjD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,uBAAuB,GAAG,2BAA2B,GAC9D,QAAQ,IAAI,2BAA2B,CAAC;AAC3C,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,wBAAwB,GAAG,4BAA4B,GAChE,QAAQ,IAAI,4BAA4B,CAAC;AAC5C,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,6BAA6B,GAAG,iCAAiC,GAC1E,QAAQ,IAAI,iCAAiC,CAAC"}
@@ -3,6 +3,8 @@
3
3
  const responseMap = {
4
4
  "POST /chat/completions": ["200"],
5
5
  "GET /info": ["200"],
6
+ "POST /embeddings": ["200"],
7
+ "POST /images/embeddings": ["200"],
6
8
  };
7
9
  export function isUnexpected(response) {
8
10
  const lroOriginal = response.headers["x-ms-original-url"];
@@ -1 +1 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,WAAW,GAA6B;IAC5C,wBAAwB,EAAE,CAAC,KAAK,CAAC;IACjC,WAAW,EAAE,CAAC,KAAK,CAAC;CACrB,CAAC;AAQF,MAAM,UAAU,YAAY,CAC1B,QAI+B;IAE/B,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,0BAA0B,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,0BAA0B,CAAC,MAAc,EAAE,IAAY;;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,+CAA+C;IAC/C,2CAA2C;IAC3C,8CAA8C;IAC9C,IAAI,UAAU,GAAG,CAAC,CAAC,EACjB,YAAY,GAAa,EAAE,CAAC;IAE9B,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CA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,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n GetChatCompletions200Response,\n GetChatCompletionsDefaultResponse,\n GetModelInfo200Response,\n GetModelInfoDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /chat/completions\": [\"200\"],\n \"GET /info\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetChatCompletions200Response | GetChatCompletionsDefaultResponse,\n): response is GetChatCompletionsDefaultResponse;\nexport function isUnexpected(\n response: GetModelInfo200Response | GetModelInfoDefaultResponse,\n): response is GetModelInfoDefaultResponse;\nexport function isUnexpected(\n response:\n | GetChatCompletions200Response\n | GetChatCompletionsDefaultResponse\n | GetModelInfo200Response\n | GetModelInfoDefaultResponse,\n): response is GetChatCompletionsDefaultResponse | GetModelInfoDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (\n let i = candidateParts.length - 1, j = pathParts.length - 1;\n i >= 1 && j >= 1;\n i--, j--\n ) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.indexOf(\"}\") !== -1\n ) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(\n `${candidateParts[i]?.slice(start, end)}`,\n ).test(pathParts[j] || \"\");\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"A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AC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n GetChatCompletions200Response,\n GetChatCompletionsDefaultResponse,\n GetModelInfo200Response,\n GetModelInfoDefaultResponse,\n GetEmbeddings200Response,\n GetEmbeddingsDefaultResponse,\n GetImageEmbeddings200Response,\n GetImageEmbeddingsDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /chat/completions\": [\"200\"],\n \"GET /info\": [\"200\"],\n \"POST /embeddings\": [\"200\"],\n \"POST /images/embeddings\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetChatCompletions200Response | GetChatCompletionsDefaultResponse,\n): response is GetChatCompletionsDefaultResponse;\nexport function isUnexpected(\n response: GetModelInfo200Response | GetModelInfoDefaultResponse,\n): response is GetModelInfoDefaultResponse;\nexport function isUnexpected(\n response: GetEmbeddings200Response | GetEmbeddingsDefaultResponse,\n): response is GetEmbeddingsDefaultResponse;\nexport function isUnexpected(\n response: GetImageEmbeddings200Response | GetImageEmbeddingsDefaultResponse,\n): response is GetImageEmbeddingsDefaultResponse;\nexport function isUnexpected(\n response:\n | GetChatCompletions200Response\n | GetChatCompletionsDefaultResponse\n | GetModelInfo200Response\n | GetModelInfoDefaultResponse\n | GetEmbeddings200Response\n | GetEmbeddingsDefaultResponse\n | GetImageEmbeddings200Response\n | GetImageEmbeddingsDefaultResponse,\n): response is\n | GetChatCompletionsDefaultResponse\n | GetModelInfoDefaultResponse\n | GetEmbeddingsDefaultResponse\n | GetImageEmbeddingsDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (\n let i = candidateParts.length - 1, j = pathParts.length - 1;\n i >= 1 && j >= 1;\n i--, j--\n ) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.indexOf(\"}\") !== -1\n ) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(\n `${candidateParts[i]?.slice(start, end)}`,\n ).test(pathParts[j] || \"\");\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -1,11 +1,16 @@
1
1
  import { ClientOptions } from "@azure-rest/core-client";
2
2
  import { TokenCredential, KeyCredential } from "@azure/core-auth";
3
3
  import { ModelClient } from "./clientDefinitions.js";
4
+ /** The optional parameters for the client */
5
+ export interface ModelClientOptions extends ClientOptions {
6
+ /** The api version option of the client */
7
+ apiVersion?: string;
8
+ }
4
9
  /**
5
10
  * Initialize a new instance of `ModelClient`
6
11
  * @param endpointParam - The parameter endpointParam
7
12
  * @param credentials - uniquely identify client credential
8
13
  * @param options - the parameter for all optional parameters
9
14
  */
10
- export default function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): ModelClient;
15
+ export default function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: ModelClientOptions): ModelClient;
11
16
  //# sourceMappingURL=modelClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modelClient.d.ts","sourceRoot":"","sources":["../../src/modelClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EACL,eAAe,EACf,aAAa,EAEd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,eAAe,GAAG,aAAa,EAC5C,OAAO,GAAE,aAAkB,GAC1B,WAAW,CAmCb"}
1
+ {"version":3,"file":"modelClient.d.ts","sourceRoot":"","sources":["../../src/modelClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EACL,eAAe,EACf,aAAa,EAEd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,6CAA6C;AAC7C,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,eAAe,GAAG,aAAa,EAC5C,EAAE,UAAiC,EAAE,GAAG,OAAO,EAAE,GAAE,kBAAuB,GACzE,WAAW,CAgDb"}
@@ -1,5 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
+ import { __rest } from "tslib";
3
4
  import { getClient } from "@azure-rest/core-client";
4
5
  import { logger } from "./logger.js";
5
6
  import { isKeyCredential, } from "@azure/core-auth";
@@ -9,11 +10,11 @@ import { isKeyCredential, } from "@azure/core-auth";
9
10
  * @param credentials - uniquely identify client credential
10
11
  * @param options - the parameter for all optional parameters
11
12
  */
12
- export default function createClient(endpointParam, credentials, options = {}) {
13
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
14
- const endpointUrl = (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUrl) !== null && _b !== void 0 ? _b : `${endpointParam}`;
15
- options.apiVersion = (_c = options.apiVersion) !== null && _c !== void 0 ? _c : "2024-05-01-preview";
16
- const userAgentInfo = `azsdk-js-ai-inference-rest/1.0.0-beta.1`;
13
+ export default function createClient(endpointParam, credentials, _a = {}) {
14
+ var _b, _c, _d, _e, _f, _g, _h, _j;
15
+ var { apiVersion = "2024-05-01-preview" } = _a, options = __rest(_a, ["apiVersion"]);
16
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpointParam}`;
17
+ const userAgentInfo = `azsdk-js-AiModelInference-rest/1.0.0-beta.2`;
17
18
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
18
19
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
19
20
  : `${userAgentInfo}`;
@@ -26,6 +27,19 @@ export default function createClient(endpointParam, credentials, options = {}) {
26
27
  apiKeyHeaderName: (_j = (_h = options.credentials) === null || _h === void 0 ? void 0 : _h.apiKeyHeaderName) !== null && _j !== void 0 ? _j : "api-key",
27
28
  } });
28
29
  const client = getClient(endpointUrl, credentials, options);
30
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
31
+ client.pipeline.addPolicy({
32
+ name: "ClientApiVersionPolicy",
33
+ sendRequest: (req, next) => {
34
+ // Use the apiVersion defined in request url directly
35
+ // Append one if there is no apiVersion and we have one at client options
36
+ const url = new URL(req.url);
37
+ if (!url.searchParams.get("api-version") && apiVersion) {
38
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
39
+ }
40
+ return next(req);
41
+ },
42
+ });
29
43
  if (isKeyCredential(credentials)) {
30
44
  client.pipeline.addPolicy({
31
45
  name: "customKeyCredentialPolicy",
@@ -1 +1 @@
1
- {"version":3,"file":"modelClient.js","sourceRoot":"","sources":["../../src/modelClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAGL,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAG1B;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,UAAyB,EAAE;;IAE3B,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC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) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport {\n TokenCredential,\n KeyCredential,\n isKeyCredential,\n} from \"@azure/core-auth\";\nimport { ModelClient } from \"./clientDefinitions.js\";\n\n/**\n * Initialize a new instance of `ModelClient`\n * @param endpointParam - The parameter endpointParam\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): ModelClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n options.apiVersion = options.apiVersion ?? \"2024-05-01-preview\";\n const userAgentInfo = `azsdk-js-ai-inference-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://ml.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"api-key\",\n },\n };\n\n const client = getClient(endpointUrl, credentials, options) as ModelClient;\n\n if (isKeyCredential(credentials)) {\n client.pipeline.addPolicy({\n name: \"customKeyCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", \"Bearer \" + credentials.key);\n return next(request);\n },\n });\n }\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"modelClient.js","sourceRoot":"","sources":["../../src/modelClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAGL,eAAe,GAChB,MAA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AAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAC5E,eAAe,UAAU,EAAE,CAAC;YAChC,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,IAAI,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,2BAA2B;YACjC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;gBAClE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport {\n TokenCredential,\n KeyCredential,\n isKeyCredential,\n} from \"@azure/core-auth\";\nimport { ModelClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface ModelClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `ModelClient`\n * @param endpointParam - The parameter endpointParam\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n { apiVersion = \"2024-05-01-preview\", ...options }: ModelClientOptions = {},\n): ModelClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-AiModelInference-rest/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://ml.azure.com/.default\"],\n apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"api-key\",\n },\n };\n const client = getClient(endpointUrl, credentials, options) as ModelClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n if (isKeyCredential(credentials)) {\n client.pipeline.addPolicy({\n name: \"customKeyCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", \"Bearer \" + credentials.key);\n return next(request);\n },\n });\n }\n\n return client;\n}\n"]}
@@ -138,6 +138,16 @@ export interface ChatCompletionsFunctionToolSelection {
138
138
  /** The name of the function that should be called. */
139
139
  name: string;
140
140
  }
141
+ /** Represents an image with optional text. */
142
+ export interface ImageEmbeddingInput {
143
+ /** The input image, in PNG format. */
144
+ image: string;
145
+ /**
146
+ * Optional. The text input to feed into the model (like DINO, CLIP).
147
+ * Returns a 422 error if the model doesn't support the value or parameter.
148
+ */
149
+ text?: string;
150
+ }
141
151
  /** An abstract representation of a chat message as provided in a request. */
142
152
  export type ChatRequestMessage = ChatRequestMessageParent | ChatRequestSystemMessage | ChatRequestUserMessage | ChatRequestAssistantMessage | ChatRequestToolMessage;
143
153
  /** An abstract representation of a structured content item within a chat message. */
@@ -151,14 +161,18 @@ export type ChatCompletionsToolCall = ChatCompletionsToolCallParent | ChatComple
151
161
  export type ChatCompletionsToolDefinition = ChatCompletionsToolDefinitionParent | ChatCompletionsFunctionToolDefinition;
152
162
  /** An abstract representation of an explicit, named tool selection to use for a chat completions request. */
153
163
  export type ChatCompletionsNamedToolSelection = ChatCompletionsNamedToolSelectionParent | ChatCompletionsNamedFunctionToolSelection;
154
- /** Alias for UnknownParams */
155
- export type UnknownParams = string | "error" | "drop" | "pass_through";
164
+ /** Alias for ExtraParameters */
165
+ export type ExtraParameters = string;
156
166
  /** Alias for ChatRole */
157
- export type ChatRole = string | "system" | "user" | "assistant" | "tool";
167
+ export type ChatRole = string;
158
168
  /** Alias for ChatMessageImageDetailLevel */
159
- export type ChatMessageImageDetailLevel = string | "auto" | "low" | "high";
169
+ export type ChatMessageImageDetailLevel = string;
160
170
  /** Alias for ChatCompletionsResponseFormat */
161
- export type ChatCompletionsResponseFormat = string | "text" | "json_object";
171
+ export type ChatCompletionsResponseFormat = string;
162
172
  /** Alias for ChatCompletionsToolSelectionPreset */
163
173
  export type ChatCompletionsToolSelectionPreset = string | "auto" | "none" | "required";
174
+ /** Alias for EmbeddingEncodingFormat */
175
+ export type EmbeddingEncodingFormat = string;
176
+ /** Alias for EmbeddingInputType */
177
+ export type EmbeddingInputType = string;
164
178
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,6EAA6E;AAC7E,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;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B,GACxB,sBAAsB,GACtB,2BAA2B,GAC3B,sBAAsB,CAAC;AAC3B,qFAAqF;AACrF,MAAM,MAAM,sBAAsB,GAC9B,4BAA4B,GAC5B,0BAA0B,GAC1B,2BAA2B,CAAC;AAChC;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAC/B,6BAA6B,GAC7B,+BAA+B,CAAC;AACpC,iHAAiH;AACjH,MAAM,MAAM,6BAA6B,GACrC,mCAAmC,GACnC,qCAAqC,CAAC;AAC1C,6GAA6G;AAC7G,MAAM,MAAM,iCAAiC,GACzC,uCAAuC,GACvC,yCAAyC,CAAC;AAC9C,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AACrC,yBAAyB;AACzB,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC9B,4CAA4C;AAC5C,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC;AACjD,8CAA8C;AAC9C,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACnD,mDAAmD;AACnD,MAAM,MAAM,kCAAkC,GAC1C,MAAM,GACN,MAAM,GACN,MAAM,GACN,UAAU,CAAC;AACf,wCAAwC;AACxC,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC7C,mCAAmC;AACnC,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** An abstract representation of a chat message as provided in a request. */\nexport interface ChatRequestMessageParent {\n role: ChatRole;\n}\n\n/**\n * A request chat message containing system instructions that influence how the model will generate a chat completions\n * response.\n */\nexport interface ChatRequestSystemMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'system' for system messages. */\n role: \"system\";\n /** The contents of the system message. */\n content: string;\n}\n\n/** A request chat message representing user input to the assistant. */\nexport interface ChatRequestUserMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'user' for user messages. */\n role: \"user\";\n /** The contents of the user message, with available input types varying by selected model. */\n content: string | Array<ChatMessageContentItem>;\n}\n\n/** An abstract representation of a structured content item within a chat message. */\nexport interface ChatMessageContentItemParent {\n type: string;\n}\n\n/** A structured chat content item containing plain text. */\nexport interface ChatMessageTextContentItem\n extends ChatMessageContentItemParent {\n /** The discriminated object type: always 'text' for this type. */\n type: \"text\";\n /** The content of the message. */\n text: string;\n}\n\n/** A structured chat content item containing an image reference. */\nexport interface ChatMessageImageContentItem\n extends ChatMessageContentItemParent {\n /** The discriminated object type: always 'image_url' for this type. */\n type: \"image_url\";\n /** An internet location, which must be accessible to the model,from which the image may be retrieved. */\n image_url: ChatMessageImageUrl;\n}\n\n/** An internet location from which the model may retrieve an image. */\nexport interface ChatMessageImageUrl {\n /** The URL of the image. */\n url: string;\n /**\n * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and\n * accuracy.\n */\n detail?: ChatMessageImageDetailLevel;\n}\n\n/** A request chat message representing response or action from the assistant. */\nexport interface ChatRequestAssistantMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'assistant' for assistant messages. */\n role: \"assistant\";\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<ChatCompletionsToolCall>;\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 interface ChatCompletionsToolCallParent {\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 ChatCompletionsFunctionToolCall\n extends ChatCompletionsToolCallParent {\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: FunctionCall;\n}\n\n/** The name and arguments of a function that should be called, as generated by the model. */\nexport interface FunctionCall {\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/** A request chat message representing requested output from a configured tool. */\nexport interface ChatRequestToolMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'tool' for tool messages. */\n role: \"tool\";\n /** The content of the message. */\n content: string | null;\n /** The ID of the tool call resolved by the provided content. */\n tool_call_id: string;\n}\n\n/** An abstract representation of a tool that can be used by the model to improve a chat completions response. */\nexport interface ChatCompletionsToolDefinitionParent {\n type: string;\n}\n\n/** The definition information for a chat completions function tool that can call a function in response to a tool call. */\nexport interface ChatCompletionsFunctionToolDefinition\n extends ChatCompletionsToolDefinitionParent {\n /** The object name, which is always 'function'. */\n type: \"function\";\n /** The function definition details for the function tool. */\n function: FunctionDefinition;\n}\n\n/** The definition of a caller-specified function that chat completions may invoke in response to matching user input. */\nexport interface FunctionDefinition {\n /** The name of the function to be called. */\n name: string;\n /**\n * A description of what the function does. The model will use this description when selecting the function and\n * interpreting its parameters.\n */\n description?: string;\n /** The parameters the function accepts, described as a JSON Schema object. */\n parameters?: unknown;\n}\n\n/** An abstract representation of an explicit, named tool selection to use for a chat completions request. */\nexport interface ChatCompletionsNamedToolSelectionParent {\n type: string;\n}\n\n/** A tool selection of a specific, named function tool that will limit chat completions to using the named function. */\nexport interface ChatCompletionsNamedFunctionToolSelection\n extends ChatCompletionsNamedToolSelectionParent {\n /** The object type, which is always 'function'. */\n type: \"function\";\n /** The function that should be called. */\n function: ChatCompletionsFunctionToolSelection;\n}\n\n/** A tool selection of a specific, named function tool that will limit chat completions to using the named function. */\nexport interface ChatCompletionsFunctionToolSelection {\n /** The name of the function that should be called. */\n name: string;\n}\n\n/** An abstract representation of a chat message as provided in a request. */\nexport type ChatRequestMessage =\n | ChatRequestMessageParent\n | ChatRequestSystemMessage\n | ChatRequestUserMessage\n | ChatRequestAssistantMessage\n | ChatRequestToolMessage;\n/** An abstract representation of a structured content item within a chat message. */\nexport type ChatMessageContentItem =\n | ChatMessageContentItemParent\n | ChatMessageTextContentItem\n | ChatMessageImageContentItem;\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 ChatCompletionsToolCall =\n | ChatCompletionsToolCallParent\n | ChatCompletionsFunctionToolCall;\n/** An abstract representation of a tool that can be used by the model to improve a chat completions response. */\nexport type ChatCompletionsToolDefinition =\n | ChatCompletionsToolDefinitionParent\n | ChatCompletionsFunctionToolDefinition;\n/** An abstract representation of an explicit, named tool selection to use for a chat completions request. */\nexport type ChatCompletionsNamedToolSelection =\n | ChatCompletionsNamedToolSelectionParent\n | ChatCompletionsNamedFunctionToolSelection;\n/** Alias for UnknownParams */\nexport type UnknownParams = string | \"error\" | \"drop\" | \"pass_through\";\n/** Alias for ChatRole */\nexport type ChatRole = string | \"system\" | \"user\" | \"assistant\" | \"tool\";\n/** Alias for ChatMessageImageDetailLevel */\nexport type ChatMessageImageDetailLevel = string | \"auto\" | \"low\" | \"high\";\n/** Alias for ChatCompletionsResponseFormat */\nexport type ChatCompletionsResponseFormat = string | \"text\" | \"json_object\";\n/** Alias for ChatCompletionsToolSelectionPreset */\nexport type ChatCompletionsToolSelectionPreset =\n | string\n | \"auto\"\n | \"none\"\n | \"required\";\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** An abstract representation of a chat message as provided in a request. */\nexport interface ChatRequestMessageParent {\n role: ChatRole;\n}\n\n/**\n * A request chat message containing system instructions that influence how the model will generate a chat completions\n * response.\n */\nexport interface ChatRequestSystemMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'system' for system messages. */\n role: \"system\";\n /** The contents of the system message. */\n content: string;\n}\n\n/** A request chat message representing user input to the assistant. */\nexport interface ChatRequestUserMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'user' for user messages. */\n role: \"user\";\n /** The contents of the user message, with available input types varying by selected model. */\n content: string | Array<ChatMessageContentItem>;\n}\n\n/** An abstract representation of a structured content item within a chat message. */\nexport interface ChatMessageContentItemParent {\n type: string;\n}\n\n/** A structured chat content item containing plain text. */\nexport interface ChatMessageTextContentItem\n extends ChatMessageContentItemParent {\n /** The discriminated object type: always 'text' for this type. */\n type: \"text\";\n /** The content of the message. */\n text: string;\n}\n\n/** A structured chat content item containing an image reference. */\nexport interface ChatMessageImageContentItem\n extends ChatMessageContentItemParent {\n /** The discriminated object type: always 'image_url' for this type. */\n type: \"image_url\";\n /** An internet location, which must be accessible to the model,from which the image may be retrieved. */\n image_url: ChatMessageImageUrl;\n}\n\n/** An internet location from which the model may retrieve an image. */\nexport interface ChatMessageImageUrl {\n /** The URL of the image. */\n url: string;\n /**\n * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and\n * accuracy.\n */\n detail?: ChatMessageImageDetailLevel;\n}\n\n/** A request chat message representing response or action from the assistant. */\nexport interface ChatRequestAssistantMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'assistant' for assistant messages. */\n role: \"assistant\";\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<ChatCompletionsToolCall>;\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 interface ChatCompletionsToolCallParent {\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 ChatCompletionsFunctionToolCall\n extends ChatCompletionsToolCallParent {\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: FunctionCall;\n}\n\n/** The name and arguments of a function that should be called, as generated by the model. */\nexport interface FunctionCall {\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/** A request chat message representing requested output from a configured tool. */\nexport interface ChatRequestToolMessage extends ChatRequestMessageParent {\n /** The chat role associated with this message, which is always 'tool' for tool messages. */\n role: \"tool\";\n /** The content of the message. */\n content: string | null;\n /** The ID of the tool call resolved by the provided content. */\n tool_call_id: string;\n}\n\n/** An abstract representation of a tool that can be used by the model to improve a chat completions response. */\nexport interface ChatCompletionsToolDefinitionParent {\n type: string;\n}\n\n/** The definition information for a chat completions function tool that can call a function in response to a tool call. */\nexport interface ChatCompletionsFunctionToolDefinition\n extends ChatCompletionsToolDefinitionParent {\n /** The object name, which is always 'function'. */\n type: \"function\";\n /** The function definition details for the function tool. */\n function: FunctionDefinition;\n}\n\n/** The definition of a caller-specified function that chat completions may invoke in response to matching user input. */\nexport interface FunctionDefinition {\n /** The name of the function to be called. */\n name: string;\n /**\n * A description of what the function does. The model will use this description when selecting the function and\n * interpreting its parameters.\n */\n description?: string;\n /** The parameters the function accepts, described as a JSON Schema object. */\n parameters?: unknown;\n}\n\n/** An abstract representation of an explicit, named tool selection to use for a chat completions request. */\nexport interface ChatCompletionsNamedToolSelectionParent {\n type: string;\n}\n\n/** A tool selection of a specific, named function tool that will limit chat completions to using the named function. */\nexport interface ChatCompletionsNamedFunctionToolSelection\n extends ChatCompletionsNamedToolSelectionParent {\n /** The object type, which is always 'function'. */\n type: \"function\";\n /** The function that should be called. */\n function: ChatCompletionsFunctionToolSelection;\n}\n\n/** A tool selection of a specific, named function tool that will limit chat completions to using the named function. */\nexport interface ChatCompletionsFunctionToolSelection {\n /** The name of the function that should be called. */\n name: string;\n}\n\n/** Represents an image with optional text. */\nexport interface ImageEmbeddingInput {\n /** The input image, in PNG format. */\n image: string;\n /**\n * Optional. The text input to feed into the model (like DINO, CLIP).\n * Returns a 422 error if the model doesn't support the value or parameter.\n */\n text?: string;\n}\n\n/** An abstract representation of a chat message as provided in a request. */\nexport type ChatRequestMessage =\n | ChatRequestMessageParent\n | ChatRequestSystemMessage\n | ChatRequestUserMessage\n | ChatRequestAssistantMessage\n | ChatRequestToolMessage;\n/** An abstract representation of a structured content item within a chat message. */\nexport type ChatMessageContentItem =\n | ChatMessageContentItemParent\n | ChatMessageTextContentItem\n | ChatMessageImageContentItem;\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 ChatCompletionsToolCall =\n | ChatCompletionsToolCallParent\n | ChatCompletionsFunctionToolCall;\n/** An abstract representation of a tool that can be used by the model to improve a chat completions response. */\nexport type ChatCompletionsToolDefinition =\n | ChatCompletionsToolDefinitionParent\n | ChatCompletionsFunctionToolDefinition;\n/** An abstract representation of an explicit, named tool selection to use for a chat completions request. */\nexport type ChatCompletionsNamedToolSelection =\n | ChatCompletionsNamedToolSelectionParent\n | ChatCompletionsNamedFunctionToolSelection;\n/** Alias for ExtraParameters */\nexport type ExtraParameters = string;\n/** Alias for ChatRole */\nexport type ChatRole = string;\n/** Alias for ChatMessageImageDetailLevel */\nexport type ChatMessageImageDetailLevel = string;\n/** Alias for ChatCompletionsResponseFormat */\nexport type ChatCompletionsResponseFormat = string;\n/** Alias for ChatCompletionsToolSelectionPreset */\nexport type ChatCompletionsToolSelectionPreset =\n | string\n | \"auto\"\n | \"none\"\n | \"required\";\n/** Alias for EmbeddingEncodingFormat */\nexport type EmbeddingEncodingFormat = string;\n/** Alias for EmbeddingInputType */\nexport type EmbeddingInputType = string;\n"]}
@@ -100,15 +100,50 @@ export interface ModelInfoOutput {
100
100
  /** The model provider name. For example: `Microsoft Research` */
101
101
  model_provider_name: string;
102
102
  }
103
+ /**
104
+ * Representation of the response data from an embeddings request.
105
+ * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,
106
+ * recommendations, and other similar scenarios.
107
+ */
108
+ export interface EmbeddingsResultOutput {
109
+ /** Unique identifier for the embeddings result. */
110
+ id: string;
111
+ /** Embedding values for the prompts submitted in the request. */
112
+ data: Array<EmbeddingItemOutput>;
113
+ /** Usage counts for tokens input using the embeddings API. */
114
+ usage: EmbeddingsUsageOutput;
115
+ /** The model ID used to generate this result. */
116
+ model: string;
117
+ }
118
+ /** Representation of a single embeddings relatedness comparison. */
119
+ export interface EmbeddingItemOutput {
120
+ /**
121
+ * List of embeddings value for the input prompt. These represent a measurement of the
122
+ * vector-based relatedness of the provided input.
123
+ */
124
+ embedding: number[];
125
+ /** Index of the prompt to which the EmbeddingItem corresponds. */
126
+ index: number;
127
+ }
128
+ /** Measurement of the amount of tokens used in this request and response. */
129
+ export interface EmbeddingsUsageOutput {
130
+ /** Number of tokens in the request. */
131
+ prompt_tokens: number;
132
+ /**
133
+ * Total number of tokens transacted in this request/response. Should equal the
134
+ * number of tokens in the request.
135
+ */
136
+ total_tokens: number;
137
+ }
103
138
  /**
104
139
  * An abstract representation of a tool call that must be resolved in a subsequent request to perform the requested
105
140
  * chat completion.
106
141
  */
107
142
  export type ChatCompletionsToolCallOutput = ChatCompletionsToolCallOutputParent | ChatCompletionsFunctionToolCallOutput;
108
143
  /** Alias for ChatRoleOutput */
109
- export type ChatRoleOutput = string | "system" | "user" | "assistant" | "tool";
144
+ export type ChatRoleOutput = string;
110
145
  /** Alias for CompletionsFinishReasonOutput */
111
- export type CompletionsFinishReasonOutput = string | "stop" | "length" | "content_filter" | "tool_calls";
146
+ export type CompletionsFinishReasonOutput = string;
112
147
  /** Alias for ModelTypeOutput */
113
- export type ModelTypeOutput = string | "embeddings" | "image_generation" | "text_generation" | "image_embeddings" | "audio_generation" | "chat";
148
+ export type ModelTypeOutput = string;
114
149
  //# sourceMappingURL=outputModels.d.ts.map
@@ -1 +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;;;;OAIG;IACH,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,aAAa,EAAE,6BAA6B,GAAG,IAAI,CAAC;IACpD,4DAA4D;IAC5D,OAAO,EAAE,yBAAyB,CAAC;CACpC;AAED,oEAAoE;AACpE,MAAM,WAAW,yBAAyB;IACxC,iDAAiD;IACjD,IA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C,CAAC;IACjC,8DAA8D;IAC9D,KAAK,EAAE,qBAAqB,CAAC;IAC7B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oEAAoE;AACpE,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,6EAA6E;AAC7E,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACrC,mCAAmC,GACnC,qCAAqC,CAAC;AAC1C,+BAA+B;AAC/B,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,8CAA8C;AAC9C,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACnD,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC"}
@@ -1 +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"]}
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 * Representation of the response data from an embeddings request.\n * Embeddings measure the relatedness of text strings and are commonly used for search, clustering,\n * recommendations, and other similar scenarios.\n */\nexport interface EmbeddingsResultOutput {\n /** Unique identifier for the embeddings result. */\n id: string;\n /** Embedding values for the prompts submitted in the request. */\n data: Array<EmbeddingItemOutput>;\n /** Usage counts for tokens input using the embeddings API. */\n usage: EmbeddingsUsageOutput;\n /** The model ID used to generate this result. */\n model: string;\n}\n\n/** Representation of a single embeddings relatedness comparison. */\nexport interface EmbeddingItemOutput {\n /**\n * List of embeddings value for the input prompt. These represent a measurement of the\n * vector-based relatedness of the provided input.\n */\n embedding: number[];\n /** Index of the prompt to which the EmbeddingItem corresponds. */\n index: number;\n}\n\n/** Measurement of the amount of tokens used in this request and response. */\nexport interface EmbeddingsUsageOutput {\n /** Number of tokens in the request. */\n prompt_tokens: number;\n /**\n * Total number of tokens transacted in this request/response. Should equal the\n * number of tokens in the request.\n */\n total_tokens: number;\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;\n/** Alias for CompletionsFinishReasonOutput */\nexport type CompletionsFinishReasonOutput = string;\n/** Alias for ModelTypeOutput */\nexport type ModelTypeOutput = string;\n"]}
@@ -1,12 +1,13 @@
1
1
  import { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
2
2
  import { RequestParameters } from "@azure-rest/core-client";
3
- import { UnknownParams, ChatRequestMessage, ChatCompletionsResponseFormat, ChatCompletionsToolDefinition, ChatCompletionsToolSelectionPreset, ChatCompletionsNamedToolSelection } from "./models.js";
3
+ import { ExtraParameters, ChatRequestMessage, ChatCompletionsResponseFormat, ChatCompletionsToolDefinition, ChatCompletionsToolSelectionPreset, ChatCompletionsNamedToolSelection, EmbeddingEncodingFormat, EmbeddingInputType, ImageEmbeddingInput } from "./models.js";
4
4
  export interface GetChatCompletionsHeaders {
5
5
  /**
6
- * Controls what happens if unknown parameters are passed in the JSON request payload.
7
- * This sets the HTTP request header `unknown-parameters`.
6
+ * Controls what happens if extra parameters, undefined by the REST API,
7
+ * are passed in the JSON request payload.
8
+ * This sets the HTTP request header `extra-parameters`.
8
9
  */
9
- "unknown-parameters"?: UnknownParams;
10
+ "extra-parameters"?: ExtraParameters;
10
11
  }
11
12
  export interface GetChatCompletionsBodyParam {
12
13
  body?: {
@@ -30,4 +31,46 @@ export interface GetChatCompletionsHeaderParam {
30
31
  }
31
32
  export type GetChatCompletionsParameters = GetChatCompletionsHeaderParam & GetChatCompletionsBodyParam & RequestParameters;
32
33
  export type GetModelInfoParameters = RequestParameters;
34
+ export interface GetEmbeddingsHeaders {
35
+ /**
36
+ * Controls what happens if extra parameters, undefined by the REST API,
37
+ * are passed in the JSON request payload.
38
+ * This sets the HTTP request header `extra-parameters`.
39
+ */
40
+ "extra-parameters"?: ExtraParameters;
41
+ }
42
+ export interface GetEmbeddingsBodyParam {
43
+ body?: {
44
+ input: string[];
45
+ dimensions?: number;
46
+ encoding_format?: EmbeddingEncodingFormat;
47
+ input_type?: EmbeddingInputType;
48
+ model?: string;
49
+ };
50
+ }
51
+ export interface GetEmbeddingsHeaderParam {
52
+ headers?: RawHttpHeadersInput & GetEmbeddingsHeaders;
53
+ }
54
+ export type GetEmbeddingsParameters = GetEmbeddingsHeaderParam & GetEmbeddingsBodyParam & RequestParameters;
55
+ export interface GetImageEmbeddingsHeaders {
56
+ /**
57
+ * Controls what happens if extra parameters, undefined by the REST API,
58
+ * are passed in the JSON request payload.
59
+ * This sets the HTTP request header `extra-parameters`.
60
+ */
61
+ "extra-parameters"?: ExtraParameters;
62
+ }
63
+ export interface GetImageEmbeddingsBodyParam {
64
+ body?: {
65
+ input: Array<ImageEmbeddingInput>;
66
+ dimensions?: number;
67
+ encoding_format?: EmbeddingEncodingFormat;
68
+ input_type?: EmbeddingInputType;
69
+ model?: string;
70
+ };
71
+ }
72
+ export interface GetImageEmbeddingsHeaderParam {
73
+ headers?: RawHttpHeadersInput & GetImageEmbeddingsHeaders;
74
+ }
75
+ export type GetImageEmbeddingsParameters = GetImageEmbeddingsHeaderParam & GetImageEmbeddingsBodyParam & RequestParameters;
33
76
  //# sourceMappingURL=parameters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAC7B,kCAAkC,EAClC,iCAAiC,EAClC,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,aAAa,CAAC;CACtC;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE;QACL,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,CAAC,EAAE,6BAA6B,CAAC;QAChD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,CAAC,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7C,WA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