Skip to content

GML-2008 GML-2009 Azure Library Upgrades#14

Merged
chengbiao-jin merged 1 commit into
mainfrom
GML-2009-Azure-Upgrade
Oct 28, 2025
Merged

GML-2008 GML-2009 Azure Library Upgrades#14
chengbiao-jin merged 1 commit into
mainfrom
GML-2009-Azure-Upgrade

Conversation

@chengbiao-jin

@chengbiao-jin chengbiao-jin commented Oct 28, 2025

Copy link
Copy Markdown
Collaborator

PR Type

Enhancement


Description

  • Migrate Azure imports to langchain_openai.

  • Add Bedrock botocore client configuration.

  • Support token_limit for Azure/Google LLMs.

  • Default model/region for Bedrock embeddings.


Diagram Walkthrough

flowchart LR
  A["Azure OpenAI services"]:::n --> B["Use langchain_openai"]:::n
  C["Bedrock services"]:::n --> D["botocore client config"]:::n
  E["LLMs: Azure & Google"]:::n --> F["Optional token_limit"]:::n
  G["Embeddings: Azure/AWS"]:::n --> H["Model/dimensions & region defaults"]:::n

  classDef n fill:#eef,stroke:#55f,stroke-width:1px
Loading

File Walkthrough

Relevant files
Enhancement
embedding_services.py
Azure embeddings migration and Bedrock client tuning         

common/embeddings/embedding_services.py

  • Swap to langchain_openai Azure embeddings.
  • Pass model and dimensions explicitly.
  • Add botocore client config for Bedrock.
  • Default Bedrock model and configurable region.
+13/-5   
azure_openai_service.py
AzureChatOpenAI migration and token limit support               

common/llm_services/azure_openai_service.py

  • Migrate to langchain_openai AzureChatOpenAI.
  • Add optional max_tokens from token_limit.
+2/-1     
google_genai_service.py
Google GenAI token limit configuration                                     

common/llm_services/google_genai_service.py

  • Use token_limit for max_tokens.
  • Keep other model settings unchanged.
+1/-1     
Configuration changes
aws_bedrock_service.py
Bedrock LLM boto3/botocore client configuration                   

common/llm_services/aws_bedrock_service.py

  • Import botocore and build client config.
  • Configure retries, timeouts, and pool size.
  • Pass config and region to Bedrock client.
+10/-1   

@tg-pr-agent

tg-pr-agent Bot commented Oct 28, 2025

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

AzureOpenAIEmbeddings from langchain_openai likely expects the azure_deployment argument (not deployment). Passing deployment may raise a constructor error; also verify whether model is needed when using Azure deployments.

from langchain_openai import AzureOpenAIEmbeddings

self.embeddings = AzureOpenAIEmbeddings(model=self.model_name, dimensions=self.dimensions, deployment=config["azure_deployment"])
Possible Issue

AzureChatOpenAI from langchain_openai typically uses model (not model_name). Using model_name= can result in an unexpected keyword argument error. Also confirm that max_tokens is supported in the installed version.

self.llm = AzureChatOpenAI(
    azure_deployment=config["azure_deployment"],
    openai_api_version=config["openai_api_version"],
    model_name=config["llm_model"],
    max_tokens=config.get("token_limit"),
    temperature=config["model_kwargs"]["temperature"],
)
Parameter Name Mismatch

ChatGoogleGenerativeAI commonly uses max_output_tokens rather than max_tokens. If max_tokens is unsupported, the limit may be ignored or raise an error. Verify against the installed langchain-google-genai version.

self.llm = ChatGoogleGenerativeAI(
    temperature=config["model_kwargs"]["temperature"],
    model=model_name,
    max_tokens=config.get("token_limit"),
    timeout=None,
    max_retries=2,
)

@chengbiao-jin
chengbiao-jin merged commit 4787eb8 into main Oct 28, 2025
1 check failed
@chengbiao-jin
chengbiao-jin deleted the GML-2009-Azure-Upgrade branch October 28, 2025 05:04
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.

1 participant