Function calling and better LangChain interop in version 0.6.1 **breaking change** #9
Stevenic
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I just published version 0.6.1 which includes support for OpenAI functions and has better LangChain interop.
** Breaking Changes**
I switched to a more LangChain style of creating models and embeddings. So instead of creating an
OpenAIClientthat supports both prompt completion and embeddings, you now have to define anOpenAIModelor anOpenAIEmbedding. This led to some other simplifications (for example there's no separate AzureOpenAIClient` now) but it is a breaking change. See the samples for updated example usage.Function Calling
You can now pass a list of functions to call to
gpt-3.5-turboandgpt-4chat completion models. See this sample for an example using their weather example.A new FunctionResponseValidator will be automatically created for you anytime you pass in a model that includes functions. This validator has been tuned to prevent the model from hallucinating missing or invalid function names and to repair missing or invalid function arguments. Please let me know if you encounter a function call it isn't able to repair.
LangChain Interop
The switch to LangChain style models & embeddings allowed for better two-way interop with LangChain.js. There's a new LangChainModel class that supports both frameworks simultaneously. You can pass an AlphaWave model into the constructor and then use the model in a LangChain based app, likewise you can pass a LangChain based model into the constructor and then pass the model to an AlphaWave. There's also a new LangChainEmbeddings class that does the same thing for embeddings.
If you'd like to simply add the power of AlphaWave to your LangChain app you can use the AlphaWaveModel class to wrap any other model with repair logic...
Beta Was this translation helpful? Give feedback.
All reactions