Skip to content

Commit efc621e

Browse files
committed
Formatted convo
1 parent 480b41d commit efc621e

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

apps/execution-worker/src/durable-objects/execution-agent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ ${input.taskDescription}`,
191191
.withTags({
192192
agentId: input.agentId,
193193
conversationId: input.conversationId,
194+
result: result.text,
194195
})
195196
.info("ExecutionAgent: Pinging interaction worker with completion");
196197

apps/interaction-worker/src/services/process-message/process-agent-completion.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export const processAgentCompletion = async (
3030
success,
3131
});
3232

33+
completionLogger.info(input)
34+
3335
try {
3436
// Get the execution agent
3537
const executionAgent = await db.query.agents.findFirst({
@@ -157,7 +159,7 @@ export const processAgentCompletion = async (
157159

158160
// Format conversation with the new agent message
159161
const formattedConversation = formatAgentConversation({
160-
conversationHistory: conversationHistory.map((msg: any) => ({
162+
conversationHistory: conversationHistory.map((msg) => ({
161163
message: msg,
162164
parts: msg.parts,
163165
})),
@@ -171,21 +173,24 @@ export const processAgentCompletion = async (
171173
isGroup: conversation.isGroup,
172174
});
173175

176+
logger.info("Formatted conversation", {
177+
formattedConversation,
178+
});
179+
174180
// Generate response from interaction agent
175-
const { messagesToUser, hasUserMessages, usage } = await generateResponse(
181+
const { messagesToUser, hasUserMessages, } = await generateResponse(
176182
formattedConversation,
177183
{
178184
conversation,
179-
conversationHistory: conversationHistory.map((msg: any) => ({
185+
conversationHistory: conversationHistory.map((msg) => ({
180186
message: msg,
181187
parts: msg.parts,
182188
})),
183189
participants: [],
184190
env,
185191
db,
186192
interactionAgentId: interactionAgent.id,
187-
currentMessage: newMessage as any,
188-
currentParts: [],
193+
currentMessage: newMessage,
189194
},
190195
);
191196

apps/interaction-worker/src/services/process-message/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { Database } from "../../db/client";
44

55
export type ProcessMessageOptions = {
66
currentMessage: Message;
7-
currentParts: Part[];
87
conversation: Conversation;
98
conversationHistory: { message: Message; parts: Part[] }[];
109
participants: User[];

0 commit comments

Comments
 (0)