Changesets · Branches · Tags · Compare
| Changeset | bdbad06b302ddf9e6a362b7bcf70aea36fa6ffbb5ae7868a254d87a412157bdd |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-05-26 18:33 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-05-26 18:33 +05:30 |
| Parents | 2e6c624272fb |
5 files changed
modified core/data/log.test.ts +5 −2
| @@ -20,13 +20,14 @@ | ||
| 20 | 20 | }; |
| 21 | 21 | |
| 22 | 22 | const TEST_AGENT_INTERACTION_EVENT: DevDataLogEvent = { |
| 23 | - name: 'agentInteraction', | |
| 23 | + name: 'chatInteraction', | |
| 24 | 24 | data: { |
| 25 | 25 | prompt: "Hello, world!", |
| 26 | 26 | completion: "Hello, world!", |
| 27 | 27 | modelProvider: "openai", |
| 28 | 28 | modelTitle: "gpt-4", |
| 29 | 29 | sessionId: "1234", |
| 30 | + tools: ['test-tool1'] | |
| 30 | 31 | }, |
| 31 | 32 | } |
| 32 | 33 | |
| @@ -180,9 +181,11 @@ | ||
| 180 | 181 | |
| 181 | 182 | // Read file contents and verify |
| 182 | 183 | const fileContent = fs.readFileSync(filepath, "utf8"); |
| 183 | - expect(fileContent).toContain('"eventName":"agentInteraction"'); | |
| 184 | + console.log('debug1 filecontent', fileContent) | |
| 185 | + expect(fileContent).toContain('"eventName":"chatInteraction"'); | |
| 184 | 186 | expect(fileContent).toContain('"prompt":"Hello, world!"'); |
| 185 | 187 | expect(fileContent).toContain('"completion":"Hello, world!"'); |
| 188 | + expect(fileContent).toContain('"tools":["test-tool1"]'); | |
| 186 | 189 | }) |
| 187 | 190 | }); |
| 188 | 191 |
modified gui/src/redux/thunks/streamNormalInput.ts +5 −1
| @@ -36,6 +36,7 @@ | ||
| 36 | 36 | throw new Error("Default model not defined"); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | + const isInEdit = state.session.isInEdit; | |
| 39 | 40 | let completionOptions: LLMFullCompletionOptions = {}; |
| 40 | 41 | const activeTools = selectActiveTools(state); |
| 41 | 42 | const toolsSupported = modelSupportsTools(selectedChatModel); |
| @@ -75,13 +76,16 @@ | ||
| 75 | 76 | try { |
| 76 | 77 | if (state.session.mode === "chat" || state.session.mode === "agent") { |
| 77 | 78 | extra.ideMessenger.post("devdata/log", { |
| 78 | - name: state.session.mode === 'chat' ? "chatInteraction" : "agentInteraction", | |
| 79 | + name: "chatInteraction", | |
| 79 | 80 | data: { |
| 80 | 81 | prompt: next.value.prompt, |
| 81 | 82 | completion: next.value.completion, |
| 82 | 83 | modelProvider: selectedChatModel.underlyingProviderName, |
| 83 | 84 | modelTitle: selectedChatModel.title, |
| 84 | 85 | sessionId: state.session.id, |
| 86 | + ...(isInEdit && { | |
| 87 | + tools: activeTools.map((tool) => tool.function.name), | |
| 88 | + }), | |
| 85 | 89 | }, |
| 86 | 90 | }); |
| 87 | 91 | } |
modified packages/config-yaml/src/schemas/data/chatInteraction/index.ts +1 −0
| @@ -7,4 +7,5 @@ | ||
| 7 | 7 | prompt: z.string(), |
| 8 | 8 | completion: z.string(), |
| 9 | 9 | sessionId: z.string(), |
| 10 | + tools: z.array(z.string()).optional() | |
| 10 | 11 | }); |
modified packages/config-yaml/src/schemas/data/chatInteraction/v0.2.0.ts +1 −0
| @@ -16,6 +16,7 @@ | ||
| 16 | 16 | modelTitle: true, |
| 17 | 17 | modelProvider: true, |
| 18 | 18 | sessionId: true, |
| 19 | + tools: true | |
| 19 | 20 | }); |
| 20 | 21 | |
| 21 | 22 | export const chatInteractionEventSchema_0_2_0_noCode = |
modified packages/config-yaml/src/schemas/data/index.ts +0 −3
| @@ -72,7 +72,6 @@ | ||
| 72 | 72 | tokensGenerated: tokensGeneratedEventAllSchema, |
| 73 | 73 | chatInteraction: chatInteractionEventAllSchema, |
| 74 | 74 | editInteraction: editInteractionEventAllSchema, |
| 75 | - agentInteraction: chatInteractionEventAllSchema | |
| 76 | 75 | }); |
| 77 | 76 | |
| 78 | 77 | // Version and level specific schemas are organized here |
| @@ -98,7 +97,6 @@ | ||
| 98 | 97 | tokensGenerated: tokensGeneratedEventSchema_0_2_0, |
| 99 | 98 | chatInteraction: chatInteractionEventSchema_0_2_0, |
| 100 | 99 | editInteraction: editInteractionEventSchema_0_2_0, |
| 101 | - agentInteraction: chatInteractionEventSchema_0_2_0, | |
| 102 | 100 | }, |
| 103 | 101 | noCode: { |
| 104 | 102 | autocomplete: autocompleteEventSchema_0_2_0_noCode, |
| @@ -106,7 +104,6 @@ | ||
| 106 | 104 | tokensGenerated: tokensGeneratedEventSchema_0_2_0_noCode, |
| 107 | 105 | chatInteraction: chatInteractionEventSchema_0_2_0_noCode, |
| 108 | 106 | editInteraction: editInteractionEventSchema_0_2_0_noCode, |
| 109 | - agentInteraction: chatInteractionEventSchema_0_2_0_noCode, | |
| 110 | 107 | }, |
| 111 | 108 | }, |
| 112 | 109 | }; |