Skip to content

Commit

Permalink
✨ Fix messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
asim-shrestha committed Nov 1, 2023
1 parent 41ff8d6 commit 4676c0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
9 changes: 2 additions & 7 deletions next/src/services/agent/agent-work/execute-task-work.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { v1 } from "uuid";

import type AgentWork from "./agent-work";
import CreateTaskWork from "./create-task-work";
import type { Message } from "../../../types/message";
import type { Task } from "../../../types/task";
import { toApiModelSettings } from "../../../utils/interfaces";
Expand Down Expand Up @@ -50,13 +49,9 @@ export default class ExecuteTaskWork implements AgentWork {
};

// eslint-disable-next-line @typescript-eslint/require-await
conclude = async () => {
this.parent.api.saveMessages([
this.parent.messageService.sendMessage({ ...this.task, status: "final" }),
]);
};
conclude = async () => void 0;

next = () => (this.task.result ? new CreateTaskWork(this.parent, this.task) : undefined);
next = () => undefined;

onError = (e: unknown): boolean => {
this.parent.messageService.sendErrorMessage(e);
Expand Down
7 changes: 3 additions & 4 deletions platform/reworkd_platform/web/api/agent/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
# https://github.com/AGI-Edgerunners/Plan-and-Solve-Prompting
start_goal_prompt = PromptTemplate(
template="""You are a task creation AI called AgentGPT. You answer in the
"{language}" language. You are not a part of any system or device. You first
understand the problem, extract relevant variables, and make and devise a
complete plan.\n\n You have the following objective "{goal}". Create a list of step
by step actions to accomplish the goal. Use at most 4 steps.
"{language}" language. You have the following objective "{goal}".
Make and devise a step by step plan to accomplish the goal.
Use at most 6 steps. Do not use more steps than necessary.
Return the response as a formatted array of strings that can be used in JSON.parse()
Expand Down
4 changes: 2 additions & 2 deletions platform/reworkd_platform/web/api/agent/tools/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def call(
if len(answer_values) > 0:
snippets.append(
CitedSnippet(
0,
len(snippets) + 1,
"\n".join(answer_values),
f"https://www.google.com/search?q={quote(input_str)}",
)
Expand All @@ -87,7 +87,7 @@ async def call(
link = result["link"]
for attribute, value in result.get("attributes", {}).items():
texts.append(f"{attribute}: {value}.")
snippets.append(CitedSnippet(i + 1, "\n".join(texts), link))
snippets.append(CitedSnippet(len(snippets) + 1, "\n".join(texts), link))

if len(snippets) == 0:
return stream_string("No good Google Search Result was found", True)
Expand Down

0 comments on commit 4676c0d

Please sign in to comment.