-
Notifications
You must be signed in to change notification settings - Fork 14.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
Class that extends RunnableSerializable makes the Chain not serializable #19338
Comments
Based on the error message you provided, it seems that the To resolve this issue, you should override the class CustomRunnable(RunnableSerializable):
@classmethod
def is_lc_serializable(cls) -> bool:
"""Override to indicate this class is serializable."""
return True
def transform_meaning(self, input):
if input["input"].find("meaning"):
input["input"] = input["input"].replace("meaning", "purpose")
return input
def invoke(
self,
input: Any,
config: RunnableConfig = None,
**kwargs: Any,
) -> Any:
# Implement the custom logic here
return self.transform_meaning(input) By overriding the You can find more information about this in the Serializable class source code. Regarding the I hope this helps! If you have any other questions or need further clarification, feel free to ask. Sources
|
Thanks, @dosu-bot. That actually seems to work. I've tried setting That fixed my issue. |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
After testing many suggestions from the kaga-ai and dosu bots, it seems that classes that extends
RunnableSerializable
are still not considered to be serializable.What was expected:
RunnableSerializable
..invoke
What happened:
RunnableSerializable
to the chain, it breaks the deserialization because the graph node has the'type': 'not_implemented'
propertyOriginal discussion: #19307
System Info
The text was updated successfully, but these errors were encountered: