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

feat(agents): add remote agent #524

Merged
merged 7 commits into from
Mar 11, 2025
Merged

feat(agents): add remote agent #524

merged 7 commits into from
Mar 11, 2025

Conversation

xjacka
Copy link
Contributor

@xjacka xjacka commented Mar 7, 2025

Closes: i-am-bee/beeai#81

Description

Add remote agent

Checklist

  • I have read the contributor guide
  • I have signed off on my commit
  • Linting passes: yarn lint or yarn lint:fix
  • Formatting is applied: yarn format or yarn format:fix
  • Unit tests pass: yarn test:unit
  • E2E tests pass: yarn test:e2e
  • Tests are included
  • Documentation is changed or added
  • Commit messages and PR title follow conventional commits

Signed-off-by: Lukáš Janeček <[email protected]>
Copy link
Contributor

@Tomas2D Tomas2D left a 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) => {
Copy link
Contributor

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));
Copy link
Contributor

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.`);
Copy link
Contributor

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`);
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

shallowCopy

@xjacka xjacka marked this pull request as ready for review March 11, 2025 09:19
@xjacka xjacka requested a review from a team as a code owner March 11, 2025 09:19
@xjacka xjacka requested a review from Tomas2D March 11, 2025 09:19
@ajbozarth ajbozarth added the typescript Typescript related functionality label Mar 11, 2025
@Tomas2D Tomas2D merged commit cda7c8d into main Mar 11, 2025
7 checks passed
@Tomas2D Tomas2D deleted the remote_agent branch March 11, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Typescript related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Framework - add support for remote agent
3 participants