8000 fix: update decorators for openai extension by manvkaur · Pull Request #280 · Azure/azure-functions-python-library · GitHub
[go: up one dir, main page]

Skip to content

Conversation

manvkaur
Copy link
Contributor
@manvkaur manvkaur commented May 2, 2025

This pull request refactors and enhances the Azure Functions decorators for OpenAI integrations. The changes focus on improving parameter clarity, introducing additional configuration options, and replacing ambiguous parameter names. Key updates include a breaking change with the replacement of the model parameter with more specific alternatives (chat_model, embeddings_model), the addition of new parameters for fine-tuning model behavior, and updates to method signatures and documentation.

Refactoring and Parameter Updates:

  • Replaced the generic model parameter with chat_model or embeddings_model across methods for improved clarity and specificity. Default values for these parameters were updated to align with their respective APIs (e.g., "gpt-3.5-turbo" for chat_model and "text-embedding-ada-002" for embeddings_model). (F22bb082L3217R3217, F22bb082L3455R3510, azure/functions/decorators/function_app.pyL3479-R3527)

  • Renamed connection_name to search_connection_name or store_connection_name in relevant methods to better reflect their purpose in semantic search and embeddings storage. [1] [2]

New Parameters for Model Configuration:

  • Introduced temperature, top_p, max_tokens, and is_reasoning_model parameters in methods like text_completion_input, assistant_post_input, and semantic_search_input. These parameters enable finer control over model behavior, including sampling randomness and reasoning capabilities. (F22bb082L3217R3217, F22bb082L3376R3435, azure/functions/decorators/function_app.pyL3479-R3527)

Documentation and Type Enhancements:

  • Updated method docstrings to reflect the new parameter names and their purposes, providing clearer guidance for developers. [1] [2] [3]

Codebase Simplification:

  • Removed unused model parameters and their associated logic from method signatures and class initializations to streamline the codebase. [1] [2]

Import Adjustments:

  • Added Union to imports in azure/functions/decorators/openai.py to support the new parameter type definitions.

Related extension PR - Azure/azure-functions-openai-extension#150

@manvkaur manvkaur changed the title Update decorators for openai extension fix: update decorators for openai extension May 2, 2025
@manvkaur manvkaur marked this pull request as ready for review May 2, 2025 23:34
@hallvictoria hallvictoria merged commit 085a443 into Azure:dev May 9, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0