Skip to content

Commit

Permalink
toolz (#314)
Browse files Browse the repository at this point in the history
* Update agent kit path.

* Use different graphs for different teams.
  • Loading branch information
dglazkov authored Apr 18, 2024
1 parent 371a372 commit 41d1a6f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
6 changes: 4 additions & 2 deletions seeds/team-experiments/src/mock/team-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ export const teamListItems: Map<string, TeamListItem> = new Map([
{
datetime: new Date(Date.now() - 20 * MINUTE),
teamName: "Social Campaign",
description: "It's a social campaign",
description: "Uses simple chat (just makes up stuff)",
status: ItemStatus.ACTIVE,
statusDescription: "Brand input needed",
who: Participant.TEAM_MEMBER,
role: "Media Coordinator",
graph: "/bgl/insta/simple-chat.bgl.json",
},
],
[
Expand All @@ -26,10 +27,11 @@ export const teamListItems: Map<string, TeamListItem> = new Map([
datetime: new Date(Date.now() - 20 * MINUTE),
teamName: "Multimedia Campaign Manager Team",
description:
"It's a super long title that needs to be truncated because it's so long and it contains more information than can be fit on a single line",
"Uses 'get page' tool: ask it about various URLs and it will scrape them and summarize them",
status: ItemStatus.COMPLETE,
who: Participant.TEAM_MEMBER,
role: "Media Coordinator",
graph: "/bgl/insta/chat-with-tools.bgl.json",
},
],
[
Expand Down
1 change: 1 addition & 0 deletions seeds/team-experiments/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ export interface TeamListItem {
statusDescription?: string;
who: Participant;
role?: string;
graph?: string;
}
21 changes: 18 additions & 3 deletions seeds/team-experiments/src/ui/elements/team-job/team-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { LitElement, css, html } from "lit";
import { LitElement, PropertyValueMap, css, html } from "lit";
import { customElement, property, state } from "lit/decorators.js";
import {
ConversationItemCreateEvent,
Expand Down Expand Up @@ -61,7 +61,22 @@ export class TeamJob extends LitElement {
this.conversation = [...this.conversation, item];
}

protected willUpdate(
changedProperties:
| PropertyValueMap<{ team: TeamListItem }>
| Map<PropertyKey, unknown>
) {
if (changedProperties.has("team")) {
this.#startRun();
}
}

async #startRun() {
const url = this.team?.graph;
if (!url) {
console.warn("no graph, bailing");
return;
}
if (!(await this.#secrets.load("/api/secrets"))) {
console.warn(
"Please add `.env` file to the root of this package and place secrets there."
Expand Down Expand Up @@ -102,15 +117,15 @@ export class TeamJob extends LitElement {
});
});
this.#run.start({
url: "/bgl/insta/simple-chat.bgl.json",
url,
kits: [
asRuntimeKit(Core),
asRuntimeKit(JSONKit),
asRuntimeKit(TemplateKit),
asRuntimeKit(GeminiKit),
await load(
new URL(
"https://raw.githubusercontent.com/breadboard-ai/breadboard/f9b210cd9f1770464154eb160b1127ef01a85d65/packages/agent-kit/agent.kit.json"
"https://raw.githubusercontent.com/breadboard-ai/breadboard/18b9f34b92398632928f4897c2b53b3a2ccac4c1/packages/agent-kit/agent.kit.json"
)
),
],
Expand Down

0 comments on commit 41d1a6f

Please sign in to comment.