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

chore: Remove openai directory #13224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: Remove openai directory #13224

wants to merge 1 commit into from

Conversation

holtskinner
Copy link
Contributor

  • Samples are duplicates of chat_completions directory

- Samples are duplicates of `chat_completions` directory
@holtskinner holtskinner requested review from a team as code owners March 10, 2025 20:46
Copy link

snippet-bot bot commented Mar 10, 2025

Here is the summary of changes.

You are about to delete 6 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Mar 10, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @holtskinner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request removes the openai directory, which contains example code that duplicates the functionality found in the chat_completions directory. The files removed include examples for chat completions, image-based chat completions (both streaming and non-streaming), a credentials refresher class, and a usage example for the credentials refresher. Additionally, the associated test file, noxfile_config.py, and requirements files (requirements-test.txt and requirements.txt) within the openai directory are also removed.

Highlights

  • Removal of Duplicate Samples: The openai directory is removed because its samples are duplicates of those in the chat_completions directory, reducing redundancy in the codebase.
  • Clean Up: Associated test files, configuration, and requirements specific to the openai directory are also removed to ensure a clean and consistent project structure.

Changelog

Click here to see the changelog
  • generative_ai/openai/chat_openai_example.py
    • File removed as it duplicates functionality in the chat_completions directory.
  • generative_ai/openai/chat_openai_image_example.py
    • File removed as it duplicates functionality in the chat_completions directory.
  • generative_ai/openai/chat_openai_image_stream_example.py
    • File removed as it duplicates functionality in the chat_completions directory.
  • generative_ai/openai/chat_openai_stream_example.py
    • File removed as it duplicates functionality in the chat_completions directory.
  • generative_ai/openai/credentials_refresher_class_example.py
    • File removed as it duplicates functionality in the chat_completions directory.
  • generative_ai/openai/credentials_refresher_usage_example.py
    • File removed as it duplicates functionality in the chat_completions directory.
  • generative_ai/openai/noxfile_config.py
    • File removed as it is specific to the now-removed openai directory.
  • generative_ai/openai/requirements-test.txt
    • File removed as it is specific to the now-removed openai directory.
  • generative_ai/openai/requirements.txt
    • File removed as it is specific to the now-removed openai directory.
  • generative_ai/openai/test_openai_examples.py
    • File removed as it contains tests for the now-removed openai directory.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Trivia time!

What is the primary use case for the nox tool, often used in Python projects?

Click here for the answer
Nox is primarily used for automating testing in multiple Python environments. It can be configured to run tests with different Python versions and dependencies.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the openai directory, which contains several example files. The description indicates that these samples are duplicates of the chat_completions directory. This review focuses on ensuring that the removal is intentional and doesn't inadvertently remove necessary functionality or negatively impact documentation.

Summary of Findings

  • Removal of OpenAI directory: The pull request removes the openai directory, which contains several example files demonstrating how to use the OpenAI API with Vertex AI. This change should be carefully reviewed to ensure that the functionality provided by these examples is either no longer needed or has been migrated to another location.
  • Potential impact on documentation: The removal of these example files may impact any documentation or tutorials that reference them. It's important to update any relevant documentation to reflect these changes.

Merge Readiness

Given the potential impact on documentation and the need to ensure that the removed functionality is truly redundant, I recommend a thorough review of this pull request before merging. Ensure that all references to the removed files are updated and that the functionality is adequately covered elsewhere. I am unable to approve this pull request, and other reviewers should review and approve this code before merging.

@glasnt
Copy link
Contributor

glasnt commented Mar 10, 2025

There are active uses of these samples in the documentation (example), as well as multiple references in Samples Browser

Is there a plan to deprecate these samples first? Please provide an internal b/ link if so

@glasnt glasnt added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 10, 2025
@msampathkumar
Copy link
Member

Thank you for the clean-up job. As @glasnt mentioned, kindly update the docs to first to remove the dependency.

@holtskinner
Copy link
Contributor Author

holtskinner commented Mar 11, 2025

Docs were updated in cl/735495479

@holtskinner holtskinner removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants