-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request options are badly typed between providers. #7117
Comments
I currently made a workaround with a patch on langchain:
|
Hey there, @KristofDeTroch! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together while we wait for a human maintainer. To address the issue of type compatibility between the Your workaround involves patching the LangChain.js library to add Here's a conceptual approach to align the types:
By aligning the types and updating the class implementations, you can achieve a more streamlined and consistent interface for using different AI providers in your application. |
This is pretty provider-specific at the moment - will look into improving. |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
I want to gain visibility into my prompts with Helicone. To do this I need to add additional headers to assign properties at invoke time when using a chain. I plowed through all of the code to see where this is possible. turns out the types are not compatible.
openai:
langchainjs/libs/langchain-openai/src/chat_models.ts
Line 1560 in 37e21d2
anthropic:
langchainjs/libs/langchain-anthropic/src/chat_models.ts
Line 913 in 37e21d2
I want to streamline my application and the usage of anthropic or openai is shielded away from the implementation. To achieve the intended usecase these types should be aligned and added to the
RunnableConfig
type.System Info
@langchain/[email protected]
@langchain/[email protected]
@langchain/[email protected]
mac os
pnpm 9.1.0
node v20.12.2
The text was updated successfully, but these errors were encountered: