-
Notifications
You must be signed in to change notification settings - Fork 751
feat(chat): Initial Agentic Chat loop Setup #6844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(chat): Initial Agentic Chat loop Setup #6844
Conversation
|
packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts
Outdated
Show resolved
Hide resolved
packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts
Outdated
Show resolved
Hide resolved
packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts
Outdated
Show resolved
Hide resolved
| [key: string]: any | ||
| } | ||
|
|
||
| export function triggerPayloadToChatRequest(triggerPayload: TriggerPayload): { conversationState: ConversationState } { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the changes to a new function triggerPayloadToAgenticChatRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a new one? we can use the same function and add the API request blocks based on triggerPayload right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, then should tools also be part of triggerPayload? Because it's not needed for mynah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed, but i can make sure that Origin is present to exclude tools from the request. I'll do it in followup
packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts
Show resolved
Hide resolved
packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts
Outdated
Show resolved
Hide resolved
| const customizationArn: string | undefined = undefinedIfEmpty(triggerPayload.customization.arn) | ||
| const chatTriggerType = triggerPayload.trigger === ChatTriggerType.InlineChatMessage ? 'INLINE_CHAT' : 'MANUAL' | ||
|
|
||
| const tools: Tool[] = Object.entries(toolsJson as Record<string, ToolSpec>).map(([toolName, toolSpec]) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this won't be easily scalable to other use cases like MCP where arbitrary tools can be added. Is there a better way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have a number of static tools. I have moved this to constants. Agreed will check for a better way to handle tools.
| let result: any | ||
| const toolResults: ToolResult[] = [] | ||
| try { | ||
| switch (toolUse.name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you comment things out here intentionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes....write tools aren't merged yet.
| export const tools: Tool[] = Object.entries(toolsJson).map(([, toolSpec]) => ({ | ||
| toolSpecification: { | ||
| ...toolSpec, | ||
| inputSchema: { json: toolSpec.inputSchema }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think we don't need to do this anymore because we changed the tool index from index_schema to indexSchema
|
Synced up offline. Please follow up with:
|
2dbe485
into
aws:feature/agentic-chat
Problem
Setting up new Q Agentic Chat loop with tool use.
Solution
Initial Agentic Chat loop Setup with tool use
feature/xbranches will not be squash-merged at release time.