Skip to content

Add Sample Responses for Azure.AI.OpenAI #49799

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

v-cristhianh
Copy link
Member

@v-cristhianh v-cristhianh commented May 2, 2025

Sample Responses and some Testing

waltervvb and others added 2 commits April 29, 2025 13:11
This commit introduces a new method `ResponseImage` in the `04_Responses.cs` file. The method demonstrates how to utilize the Azure OpenAI service to generate a response based on an image and a text prompt. It initializes an `AzureOpenAIClient`, creates input parts for both the image and text, and retrieves the response, which is then printed to the console.
@github-actions github-actions bot added Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. OpenAI labels May 2, 2025
Copy link

github-actions bot commented May 2, 2025

Thank you for your contribution @v-cristhianh! We will review the pull request and get back to you soon.

Copy link
Member

@jsquire jsquire left a comment

Choose a reason for hiding this comment

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

@v-cristhianh:

Your account lacks the public GitHub organization memberships and permissions required of an internal contributor. Please review the Azure SDK onboarding documentation and use the associated Teams channel for support.

You can verify the state of your account by running the Validate-AzsdkCodeOwner script from the Azure SDK tools repository.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

Introduces a new test method `ResponseImageInput` in `ResponsesTests.cs`. This method verifies the functionality of sending an image and text prompt to the OpenAI API. It checks the response for output items and logs the input items asynchronously, enhancing the test coverage for image input handling.
@waltervvb waltervvb force-pushed the waltervvb/azure-openai-responses-samples branch from 82a6c7f to 1069fb0 Compare May 2, 2025 17:48
gregocmsft and others added 4 commits May 5, 2025 10:15
Introduced `ResponseSummarizeText` in `04_Responses.cs` to create a response based on a summarization prompt. This method utilizes an Azure OpenAI client to summarize a historical text about the Apollo 11 mission. A new private static method `GetSummarizationPromt` was also added to format the text for summarization. These changes enhance the code's functionality by enabling text summarization capabilities.
Introduced `ChatbotSummarizeTextTest` in `ResponsesTests.cs` to validate the summarization feature using the OpenAI response client. The test utilizes a predefined input about the Apollo 11 mission and includes a new private method `GetSummarizationPromt` to format the text for summarization. Assertions ensure the output is not null or empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. OpenAI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants