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

api_version is hard coded in *.py files and has different values among projects #541

Closed
bmerkle opened this issue Jul 29, 2024 · 2 comments
Assignees

Comments

@bmerkle
Copy link
Contributor

bmerkle commented Jul 29, 2024

Describe the bug
Possible improvements for the handling of api_version in *.py files

  1. the variable is often hard coded in *.py files (instead of using the .env file for specifying)
  2. the variable has different values among the projects
  3. even sometimes if had different values in the same project (e.g. 08-building-search-applications)

I could contribute a patch to improve the handling of api_version.
Open questions:

  1. on patch per project or a large ?
  2. what should be the default for the value ?

To Reproduce
Please see the example report
C:\work\microsoft\generative-ai-for-beginners\06-text-generation-apps\python\aoai-app-recipe.py (1 hit)
Line 12: api_version = "2023-10-01-preview"
C:\work\microsoft\generative-ai-for-beginners\06-text-generation-apps\python\aoai-app.py (1 hit)
Line 13: api_version = "2023-05-15"
C:\work\microsoft\generative-ai-for-beginners\06-text-generation-apps\python\aoai-history-bot.py (1 hit)
Line 12: api_version = "2023-10-01-preview"
C:\work\microsoft\generative-ai-for-beginners\06-text-generation-apps\python\aoai-study-buddy.py (1 hit)
Line 12: api_version = "2023-10-01-preview"
C:\work\microsoft\generative-ai-for-beginners\08-building-search-applications\scripts\transcript_enrich_embeddings.py (1 hit)
Line 30: openai.api_version = "2023-05-15"
C:\work\microsoft\generative-ai-for-beginners\08-building-search-applications\scripts\transcript_enrich_speaker.py (1 hit)
Line 41: openai.api_version = "2023-07-01-preview"
C:\work\microsoft\generative-ai-for-beginners\08-building-search-applications\scripts\transcript_enrich_summaries.py (1 hit)
Line 30: openai.api_version = "2023-07-01-preview"
C:\work\microsoft\generative-ai-for-beginners\09-building-image-applications\python\aoai-app-variation.py (1 hit)
Line 14: api_version = "2023-12-01-preview",
C:\work\microsoft\generative-ai-for-beginners\09-building-image-applications\python\aoai-app.py (1 hit)
Line 16: api_version = "2023-12-01-preview",
C:\work\microsoft\generative-ai-for-beginners\09-building-image-applications\python\aoai-solution.py (1 hit)
Line 16: api_version = "2023-12-01-preview",

Expected behavior

  1. handling should be unified to use the .env files for api_version and no hardcoded values in *.py files
  2. api_version should be the most recent if possible
Copy link

👋 Thanks for contributing @bmerkle! We will review the issue and get back to you soon.

@koreyspace
Copy link
Collaborator

We have hardcoded some of these values to make sure the course is operational through any of the changes. Would need to investigate / test to see if just relying on the latest values has any effect on the code.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants