Skip to content

Commit

Permalink
Re gen
Browse files Browse the repository at this point in the history
  • Loading branch information
joheredi committed Feb 1, 2023
1 parent ee6da68 commit 8845e7b
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@
"operationId": "Completions",
"description": "Return the completions for a given prompt.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "deploymentId",
"in": "path",
"required": true,
"description": "deployment id of the deployed model",
"type": "string"
},
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "body",
"in": "body",
Expand Down Expand Up @@ -190,6 +190,9 @@
"operationId": "Embeddings",
"description": "Return the embeddings for a given prompt.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "deploymentId",
"in": "path",
Expand All @@ -204,9 +207,6 @@
"description": "The ID of the end-user, for use in tracking and rate-limiting.",
"type": "string"
},
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "body",
"in": "body",
Expand Down Expand Up @@ -432,7 +432,8 @@
"properties": {
"deploymentId": {
"type": "string",
"description": "deployment id of the deployed model"
"description": "deployment id of the deployed model",
"readOnly": true
}
},
"description": "A specific deployment",
Expand Down
216 changes: 99 additions & 117 deletions packages/cadl-rlc-test/test/openai/cadl-output/review/openai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,223 +3,205 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { Client } from "@azure-rest/core-client";
import { ClientOptions } from "@azure-rest/core-client";
import { HttpResponse } from "@azure-rest/core-client";
import { KeyCredential } from "@azure/core-auth";
import { RawHttpHeaders } from "@azure/core-rest-pipeline";
import { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
import { RequestParameters } from "@azure-rest/core-client";
import { StreamableMethod } from "@azure-rest/core-client";

import { Client } from '@azure-rest/core-client';
import { ClientOptions } from '@azure-rest/core-client';
import { HttpResponse } from '@azure-rest/core-client';
import { KeyCredential } from '@azure/core-auth';
import { RawHttpHeaders } from '@azure/core-rest-pipeline';
import { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
import { RequestParameters } from '@azure-rest/core-client';
import { StreamableMethod } from '@azure-rest/core-client';

// @public (undocumented)
export type AzureOpenAIApiClient = Client & {
path: Routes;
path: Routes;
};

// @public
export interface ChoiceOutput {
finish_reason?: string;
index?: number;
logprobs?: CompletionsLogProbsModelOutput;
text?: string;
finish_reason?: string;
index?: number;
logprobs?: CompletionsLogProbsModelOutput;
text?: string;
}

// @public
export interface CompletionOutput {
choices?: Array<ChoiceOutput>;
created?: number;
id?: string;
model?: string;
object: "text_completion";
choices?: Array<ChoiceOutput>;
created?: number;
id?: string;
model?: string;
object: "text_completion";
}

// @public (undocumented)
export interface Completions {
post(
options?: CompletionsParameters
): StreamableMethod<Completions200Response | CompletionsDefaultResponse>;
post(options?: CompletionsParameters): StreamableMethod<Completions200Response | CompletionsDefaultResponse>;
}

// @public (undocumented)
export interface Completions200Headers {
"apim-request-id": string;
"apim-request-id": string;
}

// @public
export interface Completions200Response extends HttpResponse {
// (undocumented)
body: CompletionOutput;
// (undocumented)
headers: RawHttpHeaders & Completions200Headers;
// (undocumented)
status: "200";
// (undocumented)
body: CompletionOutput;
// (undocumented)
headers: RawHttpHeaders & Completions200Headers;
// (undocumented)
status: "200";
}

// @public (undocumented)
export interface CompletionsBodyParam {
// (undocumented)
body?: {
prompt: string | string[] | string[][];
max_tokens: number;
temperature: number;
top_p: number;
logit_bias: Record<string, number>;
user: string;
n: number;
stream: boolean;
logprobs: number;
model: string;
echo: boolean;
stop: string | string[];
completion_config: string;
cache_level: number;
presence_penalty: number;
frequency_penalty: number;
best_of: number;
};
// (undocumented)
body?: {
prompt: string | string[] | string[][];
max_tokens: number;
temperature: number;
top_p: number;
logit_bias: Record<string, number>;
user: string;
n: number;
stream: boolean;
logprobs: number;
model: string;
echo: boolean;
stop: string | string[];
completion_config: string;
cache_level: number;
presence_penalty: number;
frequency_penalty: number;
best_of: number;
};
}

// @public (undocumented)
export interface CompletionsDefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseOutput;
// (undocumented)
status: string;
// (undocumented)
body: ErrorResponseOutput;
// (undocumented)
status: string;
}

// @public
export interface CompletionsLogProbsModelOutput {
text_offset?: number[];
token_logprobs?: number[];
tokens?: string[];
top_logprobs?: Record<string, number>[];
text_offset?: number[];
token_logprobs?: number[];
tokens?: string[];
top_logprobs?: Record<string, number>[];
}

// @public (undocumented)
export type CompletionsParameters = CompletionsBodyParam & RequestParameters;

// @public
function createClient(
endpoint: string,
credentials: KeyCredential,
options?: ClientOptions
): AzureOpenAIApiClient;
function createClient(endpoint: string, credentials: KeyCredential, options?: ClientOptions): AzureOpenAIApiClient;
export default createClient;

// @public
export interface DeploymentOutput {
readonly deploymentId: string;
readonly deploymentId: string;
}

// @public (undocumented)
export interface EmbeddingOutput {
// (undocumented)
embedding: number[];
// (undocumented)
index: number;
// (undocumented)
object: "embedding";
// (undocumented)
embedding: number[];
// (undocumented)
index: number;
// (undocumented)
object: "embedding";
}

// @public (undocumented)
export interface Embeddings {
post(
options?: EmbeddingsParameters
): StreamableMethod<Embeddings200Response | EmbeddingsDefaultResponse>;
post(options?: EmbeddingsParameters): StreamableMethod<Embeddings200Response | EmbeddingsDefaultResponse>;
}

// @public
export interface Embeddings200Response extends HttpResponse {
// (undocumented)
body: EmbeddingsOutput;
// (undocumented)
status: "200";
// (undocumented)
body: EmbeddingsOutput;
// (undocumented)
status: "200";
}

// @public (undocumented)
export interface EmbeddingsBodyParam {
// (undocumented)
body?: {
input_type: string;
model: string;
input: string | string[] | number[] | number[][];
};
// (undocumented)
body?: {
input_type: string;
model: string;
input: string | string[] | number[] | number[][];
};
}

// @public (undocumented)
export interface EmbeddingsDefaultResponse extends HttpResponse {
// (undocumented)
body: ErrorResponseOutput;
// (undocumented)
status: string;
// (undocumented)
body: ErrorResponseOutput;
// (undocumented)
status: string;
}

// @public (undocumented)
export interface EmbeddingsHeaderParam {
// (undocumented)
headers?: RawHttpHeadersInput & EmbeddingsHeaders;
// (undocumented)
headers?: RawHttpHeadersInput & EmbeddingsHeaders;
}

// @public (undocumented)
export interface EmbeddingsHeaders {
user?: string;
user?: string;
}

// @public (undocumented)
export interface EmbeddingsOutput {
// (undocumented)
data: Array<EmbeddingOutput>;
// (undocumented)
object: "list";
// (undocumented)
data: Array<EmbeddingOutput>;
// (undocumented)
object: "list";
}

// @public (undocumented)
export type EmbeddingsParameters = EmbeddingsHeaderParam &
EmbeddingsBodyParam &
RequestParameters;
export type EmbeddingsParameters = EmbeddingsHeaderParam & EmbeddingsBodyParam & RequestParameters;

// @public
export interface ErrorModelOutput {
code: string;
details: Array<ErrorModelOutput>;
innererror?: InnerErrorOutput;
message: string;
target?: string;
code: string;
details: Array<ErrorModelOutput>;
innererror?: InnerErrorOutput;
message: string;
target?: string;
}

// @public
export interface ErrorResponseOutput {
error: ErrorModelOutput;
error: ErrorModelOutput;
}

// @public
export interface InnerErrorOutput {
code: string;
innererror?: InnerErrorOutput;
code: string;
innererror?: InnerErrorOutput;
}

// @public (undocumented)
export function isUnexpected(
response: Embeddings200Response | EmbeddingsDefaultResponse
): response is EmbeddingsDefaultResponse;
export function isUnexpected(response: Embeddings200Response | EmbeddingsDefaultResponse): response is EmbeddingsDefaultResponse;

// @public (undocumented)
export function isUnexpected(
response: Completions200Response | CompletionsDefaultResponse
): response is CompletionsDefaultResponse;
export function isUnexpected(response: Completions200Response | CompletionsDefaultResponse): response is CompletionsDefaultResponse;

// @public (undocumented)
export interface Routes {
(
path: "/deployments/{deploymentId}/embeddings",
deploymentId: string
): Embeddings;
(
path: "/deployments/{deploymentId}/completions",
deploymentId: string
): Completions;
(path: "/deployments/{deploymentId}/embeddings", deploymentId: string): Embeddings;
(path: "/deployments/{deploymentId}/completions", deploymentId: string): Completions;
}

// (No @packageDocumentation comment for this package)

```
Loading

0 comments on commit 8845e7b

Please sign in to comment.