-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat(agents): add remote agent #524
Conversation
Signed-off-by: Lukáš Janeček <[email protected]>
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.
Add exception in typescript/tests/examples/examples.test.ts
|
||
try { | ||
for await (const { prompt } of reader) { | ||
const result = await instance.run({ prompt: JSON.parse(prompt) }).observe((emitter) => { |
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.
User can make a typo in CLI, I would consider using parseBrokenJson
from @/internals/helpers/schema.ts
|
||
const runner = await this.createRunner(context); | ||
|
||
const finalMessage: Message = new AssistantMessage(await runner(input)); |
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 extract the runner's result into a variable?
const output = await runner()
); | ||
await this.input.client.connect(this.input.transport); | ||
} catch { | ||
throw new AgentError(`Can't connect to Beeai Platform.`); |
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.
throw new AgentError(`Can't connect to Beeai Platform.`, [e]);
const agents = await this.listAgents(); | ||
const agent = agents.find((agent) => agent.name === this.input.agent); | ||
if (!agent) { | ||
throw new AgentError(`Agent ${this.input.agent} is not registered in the platform`); |
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.
make it fatal
input: input.prompt, | ||
}, | ||
{ | ||
timeout: 10000000, |
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.
make it more readable 10_000_000
createSnapshot() { | ||
return { | ||
...super.createSnapshot(), | ||
input: this.input, |
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.
shallowCopy
Signed-off-by: Lukáš Janeček <[email protected]>
Signed-off-by: Lukáš Janeček <[email protected]>
Closes: i-am-bee/beeai#81
Description
Add remote agent
Checklist
yarn lint
oryarn lint:fix
yarn format
oryarn format:fix
yarn test:unit
yarn test:e2e