-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
Create new RunnableSerializable base class in preparation for configurable runnables #11279
Conversation
nfcampos
commented
Oct 2, 2023
- Also move RunnableBranch to its own file
… runnables - Also move RunnableBranch to its own file
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@@ -119,6 +122,24 @@ def output_schema(self) -> Type[BaseModel]: | |||
self.__class__.__name__ + "Output", __root__=(root_type, None) | |||
) | |||
|
|||
def config_schema( | |||
self, *, include: Optional[Sequence[str]] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain where this comes into play? This looks like the change I needed for remote runnables, but for that case I'm not sure I would've wanted the config defined as a method on runnables since config doesn't vary by runnable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will make sense in the next PR :) #11282
|
||
from langchain.load.dump import dumpd | ||
from langchain.pydantic_v1 import BaseModel | ||
from langchain.schema.runnable.base import Runnable, RunnableSerializable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_lcserializable
is a class method, so I think inheritance will work, we could define it such that anything that inherits from RunnableSerializable is in fact serializable and also provide a default namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's going a bit too far for now, but would be useful in the future
This looks good! |