Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenAI] Structured output test & samples #31476

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

minhanh-phan
Copy link
Member

@minhanh-phan minhanh-phan commented Oct 21, 2024

Add structured output samples and tests for AOAI

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@minhanh-phan minhanh-phan marked this pull request as ready for review November 14, 2024 19:08
@@ -510,8 +555,29 @@ interface ChatCompletionTestOptions {
functions?: boolean;
allowEmptyStream?: boolean;
allowEmptyId?: boolean;
structuredOutput?: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
structuredOutput?: boolean;

@@ -231,7 +276,7 @@ function assertContentFilterBlocklistIdResult(val: ContentFilterBlocklistIdResul

function assertChoice(
choice: ChatCompletion.Choice | ChatCompletionChunk.Choice,
options: ChatCompletionTestOptions,
{ ...options }: ChatCompletionTestOptions,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ ...options }: ChatCompletionTestOptions,
options: ChatCompletionTestOptions,

}

interface EmbeddingTestOptions {
dimensions?: number;
}

// Structure output interfaces
export interface Step {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor to another utils function since it is not universal

});
});
});
});
});

matrix([[APIVersion.Preview]] as const, async function (apiVersion: APIVersion) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove matrix, use skip if for describe in vitest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants