Just published version 0.7.0 of all packages and new TaskContext object for Agents #13
Stevenic
announced in
Announcements
Replies: 1 comment 2 replies
-
Cool stuff! Love the restaurant example. Been meaning to ask, I ran into issues inside a Lambda function environment because of my bundle, something to do with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The update includes a new
TaskContext
interface andAgentTaskContext
class that lets a caller manually cancel an agent mid task. It also lets commands increment the agents step count and return new thoughts to the caller. Here's an example of using the AgentTaskContext:Then elsewhere in your code you can cancel the running task by calling
this.context?.cancel()
. The agent will stop when it finishes the current step or operation its performing. You can also inspect properties off the context object to know where the agent is in its current task.A new
max_time
option lets you control how long time wise an agent is allowed to run. The default value is 60,000ms or 1 minute.These changes are technically breaking changes for commands but since I'm pretty sure I'm the only one creating new commands, it shouldn't break anyone. The samples have all been updated to reflect the new
Command
interface changes.Version 0.7.0 is on npm and also includes some other minor bug fixes.
Oh there's also two new samples, both of which use OpenAI's functions: The 09.todo-list was contributed by @rmolinamir (thank you very much) and the 04.restaurant sample is a port of TypeChat example to use AphaWave. The AlphaWave version improves on the TypeChat version by making it conversational (TypeChat only supports single shot translation of NL to JSON) but 80% of the code is directly from their sample. It's a great way to compare the two libraries.
Beta Was this translation helpful? Give feedback.
All reactions