Skip to content

Error in trace, Trace for AzureChatOpenAI with gpt-4-turbo-2024-04-09 is not correct  #24838

@mindful-time

Description

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

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
image

System Info

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigateFlagged for investigation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions