Skip to content
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 example script for ToolService with Launcher #18

Merged
merged 6 commits into from
Jun 20, 2024

Conversation

nerdai
Copy link
Contributor

@nerdai nerdai commented Jun 20, 2024

No description provided.

)
else:
messages = memory.get()
response = await self.llm.apredict_and_call(
tools_plus_human,
chat_history=messages,
error_on_no_tool_call=False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep this line 👀 But just need the latest version of core (I updated the toml in main)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i was confused why that was there, but my core wasn't updated on my local machine! Will make the change 👍🏼

# shutdown
for task in bg_tasks:
task.cancel()
mq_task.cancel()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a way to return the final result here too -- maybe a future improvement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified this to what I think is a bit more graceful shutdown.

@@ -31,10 +32,12 @@ def __init__(
services: List[BaseService],
control_plane: BaseControlPlane,
message_queue: SimpleMessageQueue,
additional_consumers: List[BaseMessageQueueConsumer] = [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we should avoid having lists as default params, due to pass-by-reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! I removed this entirely anyways though.

@nerdai nerdai marked this pull request as ready for review June 20, 2024 19:04
@nerdai nerdai changed the title [WIP] Add example script for ToolService with Launcher Add example script for ToolService with Launcher Jun 20, 2024
@nerdai nerdai merged commit 2066432 into main Jun 20, 2024
4 of 5 checks passed
@nerdai nerdai deleted the nerdai/test-service-example-script branch June 20, 2024 19:17
nerdai added a commit that referenced this pull request Jul 21, 2024
* wip

* put back error_on_no_tool_call=False

* cleaner shutdown and UX

* move registration of tool imn acall

* add deregister method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants