File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 1414from langchain .agents import create_agent
1515from langchain_core .messages import HumanMessage
1616from langchain_mcp_adapters .client import MultiServerMCPClient
17- from langchain_openai import AzureChatOpenAI , ChatOpenAI
17+ from langchain_openai import ChatOpenAI
1818from pydantic import SecretStr
1919
2020load_dotenv (override = True )
2626 azure .identity .DefaultAzureCredential (),
2727 "https://cognitiveservices.azure.com/.default" ,
2828 )
29- model = AzureChatOpenAI (
30- azure_endpoint = os .environ ["AZURE_OPENAI_ENDPOINT" ],
31- azure_deployment = os .environ ["AZURE_OPENAI_CHAT_DEPLOYMENT" ],
32- api_version = os .environ ["AZURE_OPENAI_VERSION" ],
33- azure_ad_token_provider = token_provider ,
29+ model = ChatOpenAI (
30+ model = os .environ .get ("AZURE_OPENAI_CHAT_DEPLOYMENT" ),
31+ base_url = os .environ ["AZURE_OPENAI_ENDPOINT" ] + "/openai/v1/" ,
32+ api_key = token_provider ,
3433 )
3534elif API_HOST == "github" :
3635 model = ChatOpenAI (
Original file line number Diff line number Diff line change 88from langchain .agents import create_agent
99from langchain_core .messages import HumanMessage , SystemMessage
1010from langchain_mcp_adapters .client import MultiServerMCPClient
11- from langchain_openai import AzureChatOpenAI , ChatOpenAI
11+ from langchain_openai import ChatOpenAI
1212from pydantic import SecretStr
1313from rich .logging import RichHandler
1414
3636 azure .identity .DefaultAzureCredential (),
3737 AZURE_COGNITIVE_SERVICES_SCOPE
3838 )
39- base_model = AzureChatOpenAI (
40- azure_endpoint = os .environ .get ("AZURE_OPENAI_ENDPOINT" ),
41- azure_deployment = os .environ .get ("AZURE_OPENAI_CHAT_DEPLOYMENT" ),
42- api_version = os .environ .get ("AZURE_OPENAI_VERSION" ),
43- azure_ad_token_provider = token_provider ,
39+ base_model = ChatOpenAI (
40+ model = os .environ .get ("AZURE_OPENAI_CHAT_DEPLOYMENT" ),
41+ base_url = os .environ ["AZURE_OPENAI_ENDPOINT" ] + "/openai/v1/" ,
42+ api_key = token_provider ,
4443 )
4544elif API_HOST == "github" :
4645 base_model = ChatOpenAI (
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name = "python-mcp-demos"
33version = " 0.1.0"
44description = " Demonstration of Python FastMCP servers"
55readme = " README.md"
6- requires-python = " ==3.13"
6+ requires-python = " ==3.13.* "
77dependencies = [
88 " fastmcp>=2.12.5" ,
99 " debugpy>=1.8.0" ,
You can’t perform that action at this time.
0 commit comments