-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add persistent state directory to python agents #645
Conversation
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 have left some feedback.
@cbornet please review as well
langstream-runtime/langstream-runtime-impl/src/main/python/Pipfile
Outdated
Show resolved
Hide resolved
|
||
class Agent(ABC): | ||
"""The Agent interface""" | ||
|
||
def init(self, config: Dict[str, Any]): | ||
def init(self, config: Dict[str, Any], context: AgentContext): |
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 this a breaking change ?
maybe we should have same approach as in Java and have a "setAgentContext" function
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.
no it is not, I added a test for the old syntax
print("Missing gRPC target and python class name") | ||
print("usage: python -m langstream_grpc <target> <config>") | ||
sys.exit(1) | ||
|
||
server = AgentServer(sys.argv[1], sys.argv[2]) | ||
context_config = {} | ||
if len(sys.argv) > 3: |
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.
the process is always launched by the same version of the java runtime, there is no need to do this
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.
👍
langstream-runtime/langstream-runtime-impl/src/main/python/langstream_grpc/api.py
Outdated
Show resolved
Hide resolved
langstream-runtime/langstream-runtime-impl/src/main/python/langstream_grpc/grpc_service.py
Outdated
Show resolved
Hide resolved
langstream-runtime/langstream-runtime-impl/src/main/python/langstream_grpc/api.py
Show resolved
Hide resolved
LGTM. Just some minor comments. |
Thanks I addressed your comments |
Changes:
if the agent declares init with only argument, it works as before