Checked other resources
Example Code
import os
from langchain_openai import AzureChatOpenAI
from langchain.callbacks import get_openai_callback
from langchain_core.tracers.context import collect_runs
from dotenv import load_dotenv
load_dotenv()
with get_openai_callback() as cb:
result = model.invoke(["Hi"])
print(result.response_metadata['model_name'])
print("\n")
with collect_runs() as cb:
result = model.invoke(["Hi"])
print(result.response_metadata['model_name'],"\n")
print(cb.traced_runs[0].extra['invocation_params'])
output
gpt-4-turbo-2024-04-09
gpt-4-turbo-2024-04-09
{'model': 'gpt-3.5-turbo', 'azure_deployment': 'gpt-4', 'model_name': 'gpt-3.5-turbo', 'stream': False, 'n': 1, 'temperature': 0.0, '_type': 'azure-openai-chat', 'stop': None}
Error Message and Stack Trace (if applicable)
No response
Description
Following is the screenshot of the issue

System Info
langchain = "^0.2.5"
langchain-community = "^0.2.5"
langchain-openai = "^0.1.9"
Checked other resources
Example Code
import os
from langchain_openai import AzureChatOpenAI
from langchain.callbacks import get_openai_callback
from langchain_core.tracers.context import collect_runs
from dotenv import load_dotenv
load_dotenv()
with get_openai_callback() as cb:
result = model.invoke(["Hi"])
print(result.response_metadata['model_name'])
print("\n")
with collect_runs() as cb:
result = model.invoke(["Hi"])
print(result.response_metadata['model_name'],"\n")
print(cb.traced_runs[0].extra['invocation_params'])
output
Error Message and Stack Trace (if applicable)
No response
Description
Following is the screenshot of the issue

System Info
langchain = "^0.2.5"
langchain-community = "^0.2.5"
langchain-openai = "^0.1.9"