Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bmgalego committed Feb 22, 2025
1 parent 6753645 commit 93b7494
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 2,903 deletions.
3 changes: 2 additions & 1 deletion examples/v1/deep-research/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createGroq } from "@ai-sdk/groq";
import { cli, createDreams, LogLevel } from "@daydreamsai/core/v1";
import { createDreams, LogLevel } from "@daydreamsai/core/v1";
import { cli } from "@daydreamsai/core/extensions";
import { deepResearch } from "./research";

const groq = createGroq({
Expand Down
9 changes: 7 additions & 2 deletions examples/v1/deep-research/research.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
type Debugger,
} from "@daydreamsai/core/v1";
import { z } from "zod";
import { v7 as randomUUUIDv7 } from "uuid";

export type Research = {
id: string;
Expand Down Expand Up @@ -295,6 +296,7 @@ const startDeepResearchAction = action({
.then((res) => {
ctx.workingMemory.results.push({
ref: "action_result",
id: randomUUUIDv7(),
callId: call.id,
data: res,
name: call.name,
Expand All @@ -304,7 +306,10 @@ const startDeepResearchAction = action({

research.status = "done";

return agent.run(ctx.context, ctx.args);
return agent.run({
context: ctx.context,
args: ctx.args,
});
})
.catch((err) => console.error(err));

Expand All @@ -329,7 +334,7 @@ const deepResearchContext = context({
type: "deep-research",
schema: z.string(),
key: (id) => id,
create(params, ctx) {
create() {
return researchMemory.create();
},
});
Expand Down
Loading

0 comments on commit 93b7494

Please sign in to comment.