generative-ai-for-beginners
generative-ai-for-beginners copied to clipboard
api_version is hard coded in *.py files and has different values among projects
Describe the bug Possible improvements for the handling of api_version in *.py files
- the variable is often hard coded in *.py files (instead of using the .env file for specifying)
- the variable has different values among the projects
- 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:
- on patch per project or a large ?
- 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
- handling should be unified to use the .env files for api_version and no hardcoded values in *.py files
- api_version should be the most recent if possible