Open scosman opened 2 months ago
Langchain changes their header params.
This:
llm = ChatOpenAI( openai_api_key=getenv("OPENROUTER_API_KEY"), openai_api_base=getenv("OPENROUTER_BASE_URL"), model_kwargs={ "headers": { "HTTP-Referer": getenv("APP_URL"), "X-Title": getenv("APP_TITLE"), } }, )
Should be:
llm = ChatOpenAI( openai_api_key=getenv("OPENROUTER_API_KEY"), openai_api_base=getenv("OPENROUTER_BASE_URL"), default_headers={ "HTTP-Referer": getenv("APP_URL"), "X-Title": getenv("APP_TITLE"), }, )
@scosman Thank you for providing solution! You solved my problem.
Langchain changes their header params.
This:
Should be: