From db0a0d4e8ac9323c456b5350d1e353d604e0a013 Mon Sep 17 00:00:00 2001 From: Ashish Reddy Podduturi Date: Wed, 19 Mar 2025 16:03:32 -0700 Subject: [PATCH 1/2] Adding model changes for Q Agentic Chat --- .../codewhisperer/client/user-service-2.json | 717 +++++++++++++++++- .../controllers/chat/chatRequest/converter.ts | 1 + .../@amzn/codewhisperer-streaming/README.md | 56 +- .../commands/ExportResultArchiveCommand.ts | 1 + .../GenerateAssistantResponseCommand.ts | 43 ++ .../commands/GenerateTaskAssistPlanCommand.ts | 44 ++ .../src/commands/SendMessageCommand.ts | 43 ++ .../src/models/models_0.ts | 445 +++++++++-- .../src/protocols/Aws_restJson1.ts | 109 ++- 9 files changed, 1343 insertions(+), 116 deletions(-) diff --git a/packages/core/src/codewhisperer/client/user-service-2.json b/packages/core/src/codewhisperer/client/user-service-2.json index ed7661bec4c..986b4d465b0 100644 --- a/packages/core/src/codewhisperer/client/user-service-2.json +++ b/packages/core/src/codewhisperer/client/user-service-2.json @@ -66,6 +66,23 @@ "documentation": "

Creates a pre-signed, S3 write URL for uploading a repository zip archive.

", "idempotent": true }, + "CreateWorkspace": { + "name": "CreateWorkspace", + "http": { + "method": "POST", + "requestUri": "/" + }, + "input": { "shape": "CreateWorkspaceRequest" }, + "output": { "shape": "CreateWorkspaceResponse" }, + "errors": [ + { "shape": "ThrottlingException" }, + { "shape": "ConflictException" }, + { "shape": "InternalServerException" }, + { "shape": "ValidationException" }, + { "shape": "AccessDeniedException" } + ], + "documentation": "

Create a workspace based on a workspace root

" + }, "DeleteTaskAssistConversation": { "name": "DeleteTaskAssistConversation", "http": { @@ -83,6 +100,22 @@ ], "documentation": "

API to delete task assist conversation.

" }, + "DeleteWorkspace": { + "name": "DeleteWorkspace", + "http": { + "method": "POST", + "requestUri": "/" + }, + "input": { "shape": "DeleteWorkspaceRequest" }, + "output": { "shape": "DeleteWorkspaceResponse" }, + "errors": [ + { "shape": "ThrottlingException" }, + { "shape": "InternalServerException" }, + { "shape": "ValidationException" }, + { "shape": "AccessDeniedException" } + ], + "documentation": "

Delete a workspace based on a workspaceId

" + }, "GenerateCompletions": { "name": "GenerateCompletions", "http": { @@ -215,6 +248,21 @@ { "shape": "AccessDeniedException" } ] }, + "ListAvailableProfiles": { + "name": "ListAvailableProfiles", + "http": { + "method": "POST", + "requestUri": "/" + }, + "input": { "shape": "ListAvailableProfilesRequest" }, + "output": { "shape": "ListAvailableProfilesResponse" }, + "errors": [ + { "shape": "ThrottlingException" }, + { "shape": "InternalServerException" }, + { "shape": "ValidationException" }, + { "shape": "AccessDeniedException" } + ] + }, "ListCodeAnalysisFindings": { "name": "ListCodeAnalysisFindings", "http": { @@ -248,6 +296,22 @@ ], "documentation": "

Return configruations for each feature that has been setup for A/B testing.

" }, + "ListWorkspaceMetadata": { + "name": "ListWorkspaceMetadata", + "http": { + "method": "POST", + "requestUri": "/" + }, + "input": { "shape": "ListWorkspaceMetadataRequest" }, + "output": { "shape": "ListWorkspaceMetadataResponse" }, + "errors": [ + { "shape": "ThrottlingException" }, + { "shape": "InternalServerException" }, + { "shape": "ValidationException" }, + { "shape": "AccessDeniedException" } + ], + "documentation": "

List workspace metadata based on a workspace root

" + }, "ResumeTransformation": { "name": "ResumeTransformation", "http": { @@ -404,6 +468,57 @@ "documentation": "

Reason for AccessDeniedException

", "enum": ["UNAUTHORIZED_CUSTOMIZATION_RESOURCE_ACCESS"] }, + "ActiveFunctionalityList": { + "type": "list", + "member": { "shape": "FunctionalityName" }, + "max": 10, + "min": 0 + }, + "AdditionalContentEntry": { + "type": "structure", + "required": ["name", "description"], + "members": { + "name": { + "shape": "AdditionalContentEntryNameString", + "documentation": "

The name/identifier for this context entry

" + }, + "description": { + "shape": "AdditionalContentEntryDescriptionString", + "documentation": "

A description of what this context entry represents

" + }, + "innerContext": { + "shape": "AdditionalContentEntryInnerContextString", + "documentation": "

The actual contextual content

" + } + }, + "documentation": "

Structure representing a single entry of additional contextual content

" + }, + "AdditionalContentEntryDescriptionString": { + "type": "string", + "max": 1024, + "min": 1, + "sensitive": true + }, + "AdditionalContentEntryInnerContextString": { + "type": "string", + "max": 8192, + "min": 1, + "sensitive": true + }, + "AdditionalContentEntryNameString": { + "type": "string", + "max": 1024, + "min": 1, + "pattern": "[a-z]+(?:-[a-z0-9]+)*", + "sensitive": true + }, + "AdditionalContentList": { + "type": "list", + "member": { "shape": "AdditionalContentEntry" }, + "documentation": "

A list of additional content entries, limited to 20 items

", + "max": 20, + "min": 0 + }, "AppStudioState": { "type": "structure", "required": ["namespace", "propertyName", "propertyContext"], @@ -451,6 +566,20 @@ "min": 0, "sensitive": true }, + "ApplicationProperties": { + "type": "structure", + "required": ["tenantId", "applicationArn", "tenantUrl", "applicationType"], + "members": { + "tenantId": { "shape": "TenantId" }, + "applicationArn": { "shape": "ResourceArn" }, + "tenantUrl": { "shape": "Url" }, + "applicationType": { "shape": "FunctionalityName" } + } + }, + "ApplicationPropertiesList": { + "type": "list", + "member": { "shape": "ApplicationProperties" } + }, "ArtifactId": { "type": "string", "max": 126, @@ -488,13 +617,17 @@ "followupPrompt": { "shape": "FollowupPrompt", "documentation": "

Followup Prompt

" + }, + "toolUses": { + "shape": "ToolUses", + "documentation": "

ToolUse Request

" } }, "documentation": "

Markdown text message.

" }, "AssistantResponseMessageContentString": { "type": "string", - "max": 4096, + "max": 100000, "min": 0, "sensitive": true }, @@ -508,6 +641,14 @@ "type": "boolean", "box": true }, + "ByUserAnalytics": { + "type": "structure", + "required": ["toggle"], + "members": { + "s3Uri": { "shape": "S3Uri" }, + "toggle": { "shape": "OptInFeatureToggle" } + } + }, "ChatAddMessageEvent": { "type": "structure", "required": ["conversationId", "messageId"], @@ -532,7 +673,7 @@ "type": "list", "member": { "shape": "ChatMessage" }, "documentation": "

Indicates Participant in Chat conversation

", - "max": 10, + "max": 100, "min": 0 }, "ChatInteractWithMessageEvent": { @@ -596,6 +737,11 @@ "hasProjectLevelContext": { "shape": "Boolean" } } }, + "ClientId": { + "type": "string", + "max": 255, + "min": 1 + }, "CodeAnalysisFindingsSchema": { "type": "string", "enum": ["codeanalysis/findings/1.0"] @@ -868,7 +1014,9 @@ }, "CreateTaskAssistConversationRequest": { "type": "structure", - "members": {}, + "members": { + "profileArn": { "shape": "ProfileArn" } + }, "documentation": "

Structure to represent bootstrap conversation request.

" }, "CreateTaskAssistConversationResponse": { @@ -889,7 +1037,8 @@ "artifactType": { "shape": "ArtifactType" }, "uploadIntent": { "shape": "UploadIntent" }, "uploadContext": { "shape": "UploadContext" }, - "uploadId": { "shape": "UploadId" } + "uploadId": { "shape": "UploadId" }, + "profileArn": { "shape": "ProfileArn" } } }, "CreateUploadUrlRequestContentChecksumString": { @@ -919,6 +1068,26 @@ "requestHeaders": { "shape": "RequestHeaders" } } }, + "CreateWorkspaceRequest": { + "type": "structure", + "required": ["workspaceRoot"], + "members": { + "workspaceRoot": { "shape": "CreateWorkspaceRequestWorkspaceRootString" }, + "profileArn": { "shape": "ProfileArn" } + } + }, + "CreateWorkspaceRequestWorkspaceRootString": { + "type": "string", + "max": 1024, + "min": 1 + }, + "CreateWorkspaceResponse": { + "type": "structure", + "required": ["workspace"], + "members": { + "workspace": { "shape": "WorkspaceMetadata" } + } + }, "CursorState": { "type": "structure", "members": { @@ -959,11 +1128,19 @@ "type": "list", "member": { "shape": "Customization" } }, + "DashboardAnalytics": { + "type": "structure", + "required": ["toggle"], + "members": { + "toggle": { "shape": "OptInFeatureToggle" } + } + }, "DeleteTaskAssistConversationRequest": { "type": "structure", "required": ["conversationId"], "members": { - "conversationId": { "shape": "ConversationId" } + "conversationId": { "shape": "ConversationId" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent bootstrap conversation request.

" }, @@ -975,6 +1152,18 @@ }, "documentation": "

Structure to represent bootstrap conversation response.

" }, + "DeleteWorkspaceRequest": { + "type": "structure", + "required": ["workspaceId"], + "members": { + "workspaceId": { "shape": "UUID" }, + "profileArn": { "shape": "ProfileArn" } + } + }, + "DeleteWorkspaceResponse": { + "type": "structure", + "members": {} + }, "Description": { "type": "string", "max": 256, @@ -1282,6 +1471,19 @@ "max": 100, "min": 0 }, + "ErrorDetails": { + "type": "string", + "max": 2048, + "min": 0 + }, + "ExternalIdentityDetails": { + "type": "structure", + "members": { + "issuerUrl": { "shape": "IssuerUrl" }, + "clientId": { "shape": "ClientId" }, + "scimEndpoint": { "shape": "String" } + } + }, "FeatureDevCodeAcceptanceEvent": { "type": "structure", "required": ["conversationId", "linesOfCodeAccepted", "charactersOfCodeAccepted"], @@ -1418,6 +1620,20 @@ "min": 0, "sensitive": true }, + "FunctionalityName": { + "type": "string", + "enum": [ + "COMPLETIONS", + "ANALYSIS", + "CONVERSATIONS", + "TASK_ASSIST", + "TRANSFORMATIONS", + "CHAT_CUSTOMIZATION", + "TRANSFORMATIONS_WEBAPP" + ], + "max": 64, + "min": 1 + }, "GenerateCompletionsRequest": { "type": "structure", "required": ["fileContext"], @@ -1430,7 +1646,8 @@ "customizationArn": { "shape": "CustomizationArn" }, "optOutPreference": { "shape": "OptOutPreference" }, "userContext": { "shape": "UserContext" }, - "profileArn": { "shape": "ProfileArn" } + "profileArn": { "shape": "ProfileArn" }, + "workspaceId": { "shape": "UUID" } } }, "GenerateCompletionsRequestMaxResultsInteger": { @@ -1457,7 +1674,8 @@ "type": "structure", "required": ["jobId"], "members": { - "jobId": { "shape": "GetCodeAnalysisRequestJobIdString" } + "jobId": { "shape": "GetCodeAnalysisRequestJobIdString" }, + "profileArn": { "shape": "ProfileArn" } } }, "GetCodeAnalysisRequestJobIdString": { @@ -1477,7 +1695,8 @@ "type": "structure", "required": ["jobId"], "members": { - "jobId": { "shape": "GetCodeFixJobRequestJobIdString" } + "jobId": { "shape": "GetCodeFixJobRequestJobIdString" }, + "profileArn": { "shape": "ProfileArn" } } }, "GetCodeFixJobRequestJobIdString": { @@ -1498,7 +1717,8 @@ "required": ["conversationId", "codeGenerationId"], "members": { "conversationId": { "shape": "ConversationId" }, - "codeGenerationId": { "shape": "CodeGenerationId" } + "codeGenerationId": { "shape": "CodeGenerationId" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Request for getting task assist code generation.

" }, @@ -1519,7 +1739,8 @@ "required": ["testGenerationJobGroupName", "testGenerationJobId"], "members": { "testGenerationJobGroupName": { "shape": "TestGenerationJobGroupName" }, - "testGenerationJobId": { "shape": "UUID" } + "testGenerationJobId": { "shape": "UUID" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent get test generation request.

" }, @@ -1534,7 +1755,8 @@ "type": "structure", "required": ["transformationJobId"], "members": { - "transformationJobId": { "shape": "TransformationJobId" } + "transformationJobId": { "shape": "TransformationJobId" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent get code transformation plan request.

" }, @@ -1550,7 +1772,8 @@ "type": "structure", "required": ["transformationJobId"], "members": { - "transformationJobId": { "shape": "TransformationJobId" } + "transformationJobId": { "shape": "TransformationJobId" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent get code transformation request.

" }, @@ -1589,6 +1812,47 @@ "max": 256, "min": 1 }, + "IdentityDetails": { + "type": "structure", + "members": { + "ssoIdentityDetails": { "shape": "SSOIdentityDetails" }, + "externalIdentityDetails": { "shape": "ExternalIdentityDetails" } + }, + "union": true + }, + "ImageBlock": { + "type": "structure", + "required": ["format", "source"], + "members": { + "format": { "shape": "ImageFormat" }, + "source": { "shape": "ImageSource" } + }, + "documentation": "

Represents the image source itself and the format of the image.

" + }, + "ImageBlocks": { + "type": "list", + "member": { "shape": "ImageBlock" }, + "max": 10, + "min": 0 + }, + "ImageFormat": { + "type": "string", + "enum": ["png", "jpeg", "gif", "webp"] + }, + "ImageSource": { + "type": "structure", + "members": { + "bytes": { "shape": "ImageSourceBytesBlob" } + }, + "documentation": "

Image bytes limited to ~10MB considering overhead of base64 encoding

", + "sensitive": true, + "union": true + }, + "ImageSourceBytesBlob": { + "type": "blob", + "max": 1500000, + "min": 1 + }, "Import": { "type": "structure", "members": { @@ -1656,6 +1920,11 @@ "fault": true, "retryable": { "throttling": false } }, + "IssuerUrl": { + "type": "string", + "max": 255, + "min": 1 + }, "LineRangeList": { "type": "list", "member": { "shape": "Range" } @@ -1664,7 +1933,8 @@ "type": "structure", "members": { "maxResults": { "shape": "ListAvailableCustomizationsRequestMaxResultsInteger" }, - "nextToken": { "shape": "Base64EncodedPaginationToken" } + "nextToken": { "shape": "Base64EncodedPaginationToken" }, + "profileArn": { "shape": "ProfileArn" } } }, "ListAvailableCustomizationsRequestMaxResultsInteger": { @@ -1681,13 +1951,35 @@ "nextToken": { "shape": "Base64EncodedPaginationToken" } } }, + "ListAvailableProfilesRequest": { + "type": "structure", + "members": { + "maxResults": { "shape": "ListAvailableProfilesRequestMaxResultsInteger" }, + "nextToken": { "shape": "Base64EncodedPaginationToken" } + } + }, + "ListAvailableProfilesRequestMaxResultsInteger": { + "type": "integer", + "box": true, + "max": 10, + "min": 1 + }, + "ListAvailableProfilesResponse": { + "type": "structure", + "required": ["profiles"], + "members": { + "profiles": { "shape": "ProfileList" }, + "nextToken": { "shape": "Base64EncodedPaginationToken" } + } + }, "ListCodeAnalysisFindingsRequest": { "type": "structure", "required": ["jobId", "codeAnalysisFindingsSchema"], "members": { "jobId": { "shape": "ListCodeAnalysisFindingsRequestJobIdString" }, "nextToken": { "shape": "PaginationToken" }, - "codeAnalysisFindingsSchema": { "shape": "CodeAnalysisFindingsSchema" } + "codeAnalysisFindingsSchema": { "shape": "CodeAnalysisFindingsSchema" }, + "profileArn": { "shape": "ProfileArn" } } }, "ListCodeAnalysisFindingsRequestJobIdString": { @@ -1707,7 +1999,8 @@ "type": "structure", "required": ["userContext"], "members": { - "userContext": { "shape": "UserContext" } + "userContext": { "shape": "UserContext" }, + "profileArn": { "shape": "ProfileArn" } } }, "ListFeatureEvaluationsResponse": { @@ -1717,6 +2010,29 @@ "featureEvaluations": { "shape": "FeatureEvaluationsList" } } }, + "ListWorkspaceMetadataRequest": { + "type": "structure", + "required": ["workspaceRoot"], + "members": { + "workspaceRoot": { "shape": "ListWorkspaceMetadataRequestWorkspaceRootString" }, + "nextToken": { "shape": "String" }, + "maxResults": { "shape": "Integer" }, + "profileArn": { "shape": "ProfileArn" } + } + }, + "ListWorkspaceMetadataRequestWorkspaceRootString": { + "type": "string", + "max": 1024, + "min": 1 + }, + "ListWorkspaceMetadataResponse": { + "type": "structure", + "required": ["workspaces"], + "members": { + "workspaces": { "shape": "WorkspaceList" }, + "nextToken": { "shape": "String" } + } + }, "Long": { "type": "long", "box": true @@ -1750,16 +2066,65 @@ "min": 1, "pattern": "[-a-zA-Z0-9._]*" }, + "Notifications": { + "type": "list", + "member": { "shape": "NotificationsFeature" }, + "max": 10, + "min": 0 + }, + "NotificationsFeature": { + "type": "structure", + "required": ["feature", "toggle"], + "members": { + "feature": { "shape": "FeatureName" }, + "toggle": { "shape": "OptInFeatureToggle" } + } + }, "OperatingSystem": { "type": "string", "enum": ["MAC", "WINDOWS", "LINUX"], "max": 64, "min": 1 }, + "OptInFeatureToggle": { + "type": "string", + "enum": ["ON", "OFF"] + }, + "OptInFeatures": { + "type": "structure", + "members": { + "promptLogging": { "shape": "PromptLogging" }, + "byUserAnalytics": { "shape": "ByUserAnalytics" }, + "dashboardAnalytics": { "shape": "DashboardAnalytics" }, + "notifications": { "shape": "Notifications" }, + "workspaceContext": { "shape": "WorkspaceContext" } + } + }, "OptOutPreference": { "type": "string", "enum": ["OPTIN", "OPTOUT"] }, + "Origin": { + "type": "string", + "documentation": "

Enum to represent the origin application conversing with Sidekick.

", + "enum": [ + "CHATBOT", + "CONSOLE", + "DOCUMENTATION", + "MARKETING", + "MOBILE", + "SERVICE_INTERNAL", + "UNIFIED_SEARCH", + "UNKNOWN", + "MD", + "IDE", + "SAGE_MAKER", + "CLI", + "AI_EDITOR", + "OPENSEARCH_DASHBOARD", + "GITLAB" + ] + }, "PackageInfo": { "type": "structure", "members": { @@ -1821,12 +2186,56 @@ "sensitive": true }, "PrimitiveInteger": { "type": "integer" }, + "Profile": { + "type": "structure", + "required": ["arn", "profileName"], + "members": { + "arn": { "shape": "ProfileArn" }, + "identityDetails": { "shape": "IdentityDetails" }, + "profileName": { "shape": "ProfileName" }, + "description": { "shape": "ProfileDescription" }, + "referenceTrackerConfiguration": { "shape": "ReferenceTrackerConfiguration" }, + "kmsKeyArn": { "shape": "ResourceArn" }, + "activeFunctionalities": { "shape": "ActiveFunctionalityList" }, + "status": { "shape": "ProfileStatus" }, + "errorDetails": { "shape": "ErrorDetails" }, + "resourcePolicy": { "shape": "ResourcePolicy" }, + "profileType": { "shape": "ProfileType" }, + "optInFeatures": { "shape": "OptInFeatures" }, + "permissionUpdateRequired": { "shape": "Boolean" }, + "applicationProperties": { "shape": "ApplicationPropertiesList" } + } + }, "ProfileArn": { "type": "string", "max": 950, "min": 0, "pattern": "arn:aws:codewhisperer:[-.a-z0-9]{1,63}:\\d{12}:profile/([a-zA-Z0-9]){12}" }, + "ProfileDescription": { + "type": "string", + "max": 256, + "min": 1, + "pattern": "[\\sa-zA-Z0-9_-]*" + }, + "ProfileList": { + "type": "list", + "member": { "shape": "Profile" } + }, + "ProfileName": { + "type": "string", + "max": 100, + "min": 1, + "pattern": "[a-zA-Z][a-zA-Z0-9_-]*" + }, + "ProfileStatus": { + "type": "string", + "enum": ["ACTIVE", "CREATING", "CREATE_FAILED", "UPDATING", "UPDATE_FAILED", "DELETING", "DELETE_FAILED"] + }, + "ProfileType": { + "type": "string", + "enum": ["Q_DEVELOPER", "CODEWHISPERER"] + }, "ProgrammingLanguage": { "type": "structure", "required": ["languageName"], @@ -1845,6 +2254,14 @@ "type": "list", "member": { "shape": "TransformationProgressUpdate" } }, + "PromptLogging": { + "type": "structure", + "required": ["s3Uri", "toggle"], + "members": { + "s3Uri": { "shape": "S3Uri" }, + "toggle": { "shape": "OptInFeatureToggle" } + } + }, "Range": { "type": "structure", "required": ["start", "end"], @@ -1918,7 +2335,7 @@ "RelevantDocumentList": { "type": "list", "member": { "shape": "RelevantTextDocument" }, - "max": 5, + "max": 30, "min": 0 }, "RelevantTextDocument": { @@ -1952,7 +2369,7 @@ }, "RelevantTextDocumentTextString": { "type": "string", - "max": 10240, + "max": 40960, "min": 0, "sensitive": true }, @@ -1989,12 +2406,24 @@ "documentation": "

This exception is thrown when describing a resource that does not exist.

", "exception": true }, + "ResourcePolicy": { + "type": "structure", + "required": ["effect"], + "members": { + "effect": { "shape": "ResourcePolicyEffect" } + } + }, + "ResourcePolicyEffect": { + "type": "string", + "enum": ["ALLOW", "DENY"] + }, "ResumeTransformationRequest": { "type": "structure", "required": ["transformationJobId"], "members": { "transformationJobId": { "shape": "TransformationJobId" }, - "userActionStatus": { "shape": "TransformationUserActionStatus" } + "userActionStatus": { "shape": "TransformationUserActionStatus" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent stop code transformation request.

" }, @@ -2037,6 +2466,27 @@ "min": 0, "sensitive": true }, + "S3Uri": { + "type": "string", + "max": 1024, + "min": 1, + "pattern": "s3://((?!xn--)[a-z0-9](?![^/]*[.]{2})[a-z0-9-.]{1,61}[a-z0-9](?Represents span in a text

" + "documentation": "

Represents span in a text.

" }, "SpanEndInteger": { "type": "integer", @@ -2176,7 +2632,8 @@ "idempotencyToken": true }, "scope": { "shape": "CodeAnalysisScope" }, - "codeScanName": { "shape": "CodeScanName" } + "codeScanName": { "shape": "CodeScanName" }, + "profileArn": { "shape": "ProfileArn" } } }, "StartCodeAnalysisRequestClientTokenString": { @@ -2206,7 +2663,9 @@ "uploadId": { "shape": "UploadId" }, "description": { "shape": "StartCodeFixJobRequestDescriptionString" }, "ruleId": { "shape": "StartCodeFixJobRequestRuleIdString" }, - "codeFixName": { "shape": "CodeFixName" } + "codeFixName": { "shape": "CodeFixName" }, + "referenceTrackerConfiguration": { "shape": "ReferenceTrackerConfiguration" }, + "profileArn": { "shape": "ProfileArn" } } }, "StartCodeFixJobRequestDescriptionString": { @@ -2244,7 +2703,8 @@ "codeGenerationId": { "shape": "CodeGenerationId" }, "currentCodeGenerationId": { "shape": "CodeGenerationId" }, "intent": { "shape": "Intent" }, - "intentContext": { "shape": "IntentContext" } + "intentContext": { "shape": "IntentContext" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent start code generation request.

" }, @@ -2271,7 +2731,9 @@ "clientToken": { "shape": "StartTestGenerationRequestClientTokenString", "idempotencyToken": true - } + }, + "profileArn": { "shape": "ProfileArn" }, + "referenceTrackerConfiguration": { "shape": "ReferenceTrackerConfiguration" } }, "documentation": "

Structure to represent test generation request.

" }, @@ -2298,7 +2760,8 @@ "required": ["workspaceState", "transformationSpec"], "members": { "workspaceState": { "shape": "WorkspaceState" }, - "transformationSpec": { "shape": "TransformationSpec" } + "transformationSpec": { "shape": "TransformationSpec" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent code transformation request.

" }, @@ -2319,7 +2782,8 @@ "type": "structure", "required": ["transformationJobId"], "members": { - "transformationJobId": { "shape": "TransformationJobId" } + "transformationJobId": { "shape": "TransformationJobId" }, + "profileArn": { "shape": "ProfileArn" } }, "documentation": "

Structure to represent stop code transformation request.

" }, @@ -2388,15 +2852,15 @@ "members": { "url": { "shape": "SupplementaryWebLinkUrlString", - "documentation": "

URL of the web reference link

" + "documentation": "

URL of the web reference link.

" }, "title": { "shape": "SupplementaryWebLinkTitleString", - "documentation": "

Title of the web reference link

" + "documentation": "

Title of the web reference link.

" }, "snippet": { "shape": "SupplementaryWebLinkSnippetString", - "documentation": "

Relevant text snippet from the link

" + "documentation": "

Relevant text snippet from the link.

" } }, "documentation": "

Represents an additional reference link retured with the Chat message

" @@ -2583,6 +3047,11 @@ }, "union": true }, + "TenantId": { + "type": "string", + "max": 1024, + "min": 1 + }, "TerminalUserInteractionEvent": { "type": "structure", "members": { @@ -2729,7 +3198,7 @@ }, "TextDocumentTextString": { "type": "string", - "max": 10240, + "max": 40000, "min": 0, "sensitive": true }, @@ -2750,6 +3219,124 @@ "enum": ["MONTHLY_REQUEST_COUNT"] }, "Timestamp": { "type": "timestamp" }, + "Tool": { + "type": "structure", + "members": { + "toolSpecification": { "shape": "ToolSpecification" } + }, + "documentation": "

Information about a tool that can be used.

", + "union": true + }, + "ToolDescription": { + "type": "string", + "documentation": "

The description for the tool.

", + "max": 10240, + "min": 1, + "sensitive": true + }, + "ToolInputSchema": { + "type": "structure", + "members": { + "json": { "shape": "SensitiveDocument" } + }, + "documentation": "

The input schema for the tool in JSON format.

" + }, + "ToolName": { + "type": "string", + "documentation": "

The name for the tool.

", + "max": 64, + "min": 0, + "pattern": "[a-zA-Z][a-zA-Z0-9_]*", + "sensitive": true + }, + "ToolResult": { + "type": "structure", + "required": ["toolUseId", "content"], + "members": { + "toolUseId": { "shape": "ToolUseId" }, + "content": { + "shape": "ToolResultContent", + "documentation": "

Content of the tool result.

" + }, + "status": { "shape": "ToolResultStatus" } + }, + "documentation": "

A tool result that contains the results for a tool request that was previously made.

" + }, + "ToolResultContent": { + "type": "list", + "member": { "shape": "ToolResultContentBlock" } + }, + "ToolResultContentBlock": { + "type": "structure", + "members": { + "text": { + "shape": "ToolResultContentBlockTextString", + "documentation": "

A tool result that is text.

" + }, + "json": { + "shape": "SensitiveDocument", + "documentation": "

A tool result that is JSON format data.

" + } + }, + "union": true + }, + "ToolResultContentBlockTextString": { + "type": "string", + "max": 800000, + "min": 0, + "sensitive": true + }, + "ToolResultStatus": { + "type": "string", + "documentation": "

Status of the tools result.

", + "enum": ["success", "error"] + }, + "ToolResults": { + "type": "list", + "member": { "shape": "ToolResult" }, + "max": 10, + "min": 0 + }, + "ToolSpecification": { + "type": "structure", + "required": ["inputSchema", "name"], + "members": { + "inputSchema": { "shape": "ToolInputSchema" }, + "name": { "shape": "ToolName" }, + "description": { "shape": "ToolDescription" } + }, + "documentation": "

The specification for the tool.

" + }, + "ToolUse": { + "type": "structure", + "required": ["toolUseId", "name", "input"], + "members": { + "toolUseId": { "shape": "ToolUseId" }, + "name": { "shape": "ToolName" }, + "input": { + "shape": "SensitiveDocument", + "documentation": "

The input to pass to the tool.

" + } + }, + "documentation": "

Contains information about a tool that the model is requesting be run. The model uses the result from the tool to generate a response.

" + }, + "ToolUseId": { + "type": "string", + "documentation": "

The ID for the tool request.

", + "max": 64, + "min": 0, + "pattern": "[a-zA-Z0-9_-]+" + }, + "ToolUses": { + "type": "list", + "member": { "shape": "ToolUse" }, + "max": 10, + "min": 0 + }, + "Tools": { + "type": "list", + "member": { "shape": "Tool" } + }, "TransformEvent": { "type": "structure", "required": ["jobId"], @@ -2966,7 +3553,8 @@ "taskAssistPlanningUploadContext": { "shape": "TaskAssistPlanningUploadContext" }, "transformationUploadContext": { "shape": "TransformationUploadContext" }, "codeAnalysisUploadContext": { "shape": "CodeAnalysisUploadContext" }, - "codeFixUploadContext": { "shape": "CodeFixUploadContext" } + "codeFixUploadContext": { "shape": "CodeFixUploadContext" }, + "workspaceContextUploadContext": { "shape": "WorkspaceContextUploadContext" } }, "union": true }, @@ -2985,9 +3573,15 @@ "AUTOMATIC_FILE_SECURITY_SCAN", "FULL_PROJECT_SECURITY_SCAN", "UNIT_TESTS_GENERATION", - "CODE_FIX_GENERATION" + "CODE_FIX_GENERATION", + "WORKSPACE_CONTEXT" ] }, + "Url": { + "type": "string", + "max": 1024, + "min": 1 + }, "UserContext": { "type": "structure", "required": ["ideCategory", "operatingSystem", "product"], @@ -3015,18 +3609,26 @@ }, "userInputMessageContext": { "shape": "UserInputMessageContext", - "documentation": "

Chat message context associated with the Chat Message

" + "documentation": "

Chat message context associated with the Chat Message.

" }, "userIntent": { "shape": "UserIntent", - "documentation": "

User Intent

" + "documentation": "

User Intent.

" + }, + "origin": { + "shape": "Origin", + "documentation": "

User Input Origin.

" + }, + "images": { + "shape": "ImageBlocks", + "documentation": "

Images associated with the Chat Message.

" } }, - "documentation": "

Structure to represent a chat input message from User

" + "documentation": "

Structure to represent a chat input message from User.

" }, "UserInputMessageContentString": { "type": "string", - "max": 4096, + "max": 600000, "min": 0, "sensitive": true }, @@ -3064,6 +3666,18 @@ "userSettings": { "shape": "UserSettings", "documentation": "

Settings information, e.g., whether the user has enabled cross-region API calls.

" + }, + "additionalContext": { + "shape": "AdditionalContentList", + "documentation": "

List of additional contextual content entries that can be included with the message.

" + }, + "toolResults": { + "shape": "ToolResults", + "documentation": "

ToolResults for the requested ToolUses.

" + }, + "tools": { + "shape": "Tools", + "documentation": "

Tools that can be used.

" } }, "documentation": "

Additional Chat message context associated with the Chat Message

" @@ -3156,6 +3770,35 @@ "documentation": "

Reason for ValidationException

", "enum": ["INVALID_CONVERSATION_ID", "CONTENT_LENGTH_EXCEEDS_THRESHOLD", "INVALID_KMS_GRANT"] }, + "WorkspaceContext": { + "type": "structure", + "required": ["toggle"], + "members": { + "toggle": { "shape": "OptInFeatureToggle" } + } + }, + "WorkspaceContextUploadContext": { + "type": "structure", + "required": ["workspaceId", "relativePath", "programmingLanguage"], + "members": { + "workspaceId": { "shape": "UUID" }, + "relativePath": { "shape": "SensitiveString" }, + "programmingLanguage": { "shape": "ProgrammingLanguage" } + } + }, + "WorkspaceList": { + "type": "list", + "member": { "shape": "WorkspaceMetadata" } + }, + "WorkspaceMetadata": { + "type": "structure", + "required": ["workspaceId", "workspaceStatus"], + "members": { + "workspaceId": { "shape": "UUID" }, + "workspaceStatus": { "shape": "WorkspaceStatus" }, + "environmentId": { "shape": "SensitiveString" } + } + }, "WorkspaceState": { "type": "structure", "required": ["uploadId", "programmingLanguage"], @@ -3175,6 +3818,10 @@ }, "documentation": "

Represents a Workspace state uploaded to S3 for Async Code Actions

" }, + "WorkspaceStatus": { + "type": "string", + "enum": ["CREATED", "PENDING", "READY", "CONNECTED", "DELETING"] + }, "timeBetweenChunks": { "type": "list", "member": { "shape": "Double" }, diff --git a/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts b/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts index 0a34463058e..0bd0d32791e 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts @@ -119,6 +119,7 @@ export function triggerPayloadToChatRequest(triggerPayload: TriggerPayload): { c additionalContext: triggerPayload.additionalContents, }, userIntent: triggerPayload.userIntent, + origin: 'IDE', }, }, chatTriggerType, diff --git a/src.gen/@amzn/codewhisperer-streaming/README.md b/src.gen/@amzn/codewhisperer-streaming/README.md index 5f5df60669d..ea254be0911 100644 --- a/src.gen/@amzn/codewhisperer-streaming/README.md +++ b/src.gen/@amzn/codewhisperer-streaming/README.md @@ -227,13 +227,6 @@ CreateProfile
-CreateWorkspace - - -[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/CreateWorkspaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/CreateWorkspaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/CreateWorkspaceCommandOutput/) -
-
- DeleteCustomization @@ -304,13 +297,6 @@ ListTagsForResource
-ListWorkspaceMetadata - - -[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/ListWorkspaceMetadataCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/ListWorkspaceMetadataCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/ListWorkspaceMetadataCommandOutput/) -
-
- TagResource @@ -367,6 +353,13 @@ CreateUploadUrl
+CreateWorkspace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/CreateWorkspaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/CreateWorkspaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/CreateWorkspaceCommandOutput/) +
+
+ DeleteTaskAssistConversation @@ -374,6 +367,13 @@ DeleteTaskAssistConversation
+DeleteWorkspace + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/DeleteWorkspaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/DeleteWorkspaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/DeleteWorkspaceCommandOutput/) +
+
+ GenerateCompletions @@ -451,6 +451,13 @@ ListFeatureEvaluations
+ListWorkspaceMetadata + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/ListWorkspaceMetadataCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/ListWorkspaceMetadataCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/ListWorkspaceMetadataCommandOutput/) +
+
+ ResumeTransformation @@ -570,6 +577,13 @@ DeleteAssignment
+DeleteConversation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/DeleteConversationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/DeleteConversationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/DeleteConversationCommandOutput/) +
+
+ DeleteExtension @@ -759,6 +773,20 @@ UntagResource
+UpdateConversation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/UpdateConversationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/UpdateConversationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/UpdateConversationCommandOutput/) +
+
+ +UpdatePlugin + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codewhispererstreaming/command/UpdatePluginCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/UpdatePluginCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codewhispererstreaming/Interface/UpdatePluginCommandOutput/) +
+
+ UpdateTroubleshootingCommandResult diff --git a/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts b/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts index 8b8a5016715..c2376564160 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts @@ -56,6 +56,7 @@ export interface ExportResultArchiveCommandOutput extends ExportResultArchiveRes * testGenerationJobId: "STRING_VALUE", * }, * }, + * profileArn: "STRING_VALUE", * }; * const command = new ExportResultArchiveCommand(input); * const response = await client.send(command); diff --git a/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts b/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts index 4bfdeb6aa74..93692022f1d 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts @@ -212,6 +212,15 @@ export interface GenerateAssistantResponseCommandOutput extends GenerateAssistan * ], * }, * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", + * origin: "STRING_VALUE", + * images: [ // ImageBlocks + * { // ImageBlock + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: { // ImageSource Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * }, + * ], * }, * assistantResponseMessage: { // AssistantResponseMessage * messageId: "STRING_VALUE", @@ -238,6 +247,13 @@ export interface GenerateAssistantResponseCommandOutput extends GenerateAssistan * content: "STRING_VALUE", // required * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", * }, + * toolUses: [ // ToolUses + * { // ToolUse + * toolUseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * input: "DOCUMENT_VALUE", // required + * }, + * ], * }, * }, * ], @@ -364,6 +380,15 @@ export interface GenerateAssistantResponseCommandOutput extends GenerateAssistan * ], * }, * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", + * origin: "STRING_VALUE", + * images: [ + * { + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: {// Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * }, + * ], * }, * assistantResponseMessage: { * messageId: "STRING_VALUE", @@ -390,6 +415,13 @@ export interface GenerateAssistantResponseCommandOutput extends GenerateAssistan * content: "STRING_VALUE", // required * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", * }, + * toolUses: [ + * { + * toolUseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * input: "DOCUMENT_VALUE", // required + * }, + * ], * }, * }, * chatTriggerType: "MANUAL" || "DIAGNOSTIC" || "INLINE_CHAT", // required @@ -651,6 +683,17 @@ export interface GenerateAssistantResponseCommandOutput extends GenerateAssistan * // input: "STRING_VALUE", * // stop: true || false, * // }, + * // citationEvent: { // CitationEvent + * // target: { // CitationTarget Union: only one key present + * // location: Number("int"), + * // range: { + * // start: Number("int"), + * // end: Number("int"), + * // }, + * // }, + * // citationText: "STRING_VALUE", + * // citationLink: "STRING_VALUE", // required + * // }, * // invalidStateEvent: { // InvalidStateEvent * // reason: "INVALID_TASK_ASSIST_PLAN", // required * // message: "STRING_VALUE", // required diff --git a/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts b/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts index ef188a0600a..aabf5ec6a55 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts @@ -212,6 +212,15 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * ], * }, * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", + * origin: "STRING_VALUE", + * images: [ // ImageBlocks + * { // ImageBlock + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: { // ImageSource Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * }, + * ], * }, * assistantResponseMessage: { // AssistantResponseMessage * messageId: "STRING_VALUE", @@ -238,6 +247,13 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * content: "STRING_VALUE", // required * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", * }, + * toolUses: [ // ToolUses + * { // ToolUse + * toolUseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * input: "DOCUMENT_VALUE", // required + * }, + * ], * }, * }, * ], @@ -364,6 +380,15 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * ], * }, * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", + * origin: "STRING_VALUE", + * images: [ + * { + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: {// Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * }, + * ], * }, * assistantResponseMessage: { * messageId: "STRING_VALUE", @@ -390,6 +415,13 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * content: "STRING_VALUE", // required * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", * }, + * toolUses: [ + * { + * toolUseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * input: "DOCUMENT_VALUE", // required + * }, + * ], * }, * }, * chatTriggerType: "MANUAL" || "DIAGNOSTIC" || "INLINE_CHAT", // required @@ -400,6 +432,7 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * programmingLanguage: "", // required * contextTruncationScheme: "ANALYSIS" || "GUMBY", * }, + * profileArn: "STRING_VALUE", * }; * const command = new GenerateTaskAssistPlanCommand(input); * const response = await client.send(command); @@ -654,6 +687,17 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * // input: "STRING_VALUE", * // stop: true || false, * // }, + * // citationEvent: { // CitationEvent + * // target: { // CitationTarget Union: only one key present + * // location: Number("int"), + * // range: { + * // start: Number("int"), + * // end: Number("int"), + * // }, + * // }, + * // citationText: "STRING_VALUE", + * // citationLink: "STRING_VALUE", // required + * // }, * // invalidStateEvent: { // InvalidStateEvent * // reason: "INVALID_TASK_ASSIST_PLAN", // required * // message: "STRING_VALUE", // required diff --git a/src.gen/@amzn/codewhisperer-streaming/src/commands/SendMessageCommand.ts b/src.gen/@amzn/codewhisperer-streaming/src/commands/SendMessageCommand.ts index 8a83024b54d..c040041719c 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/SendMessageCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/SendMessageCommand.ts @@ -213,6 +213,15 @@ export interface SendMessageCommandOutput extends SendMessageResponse, __Metadat * ], * }, * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", + * origin: "STRING_VALUE", + * images: [ // ImageBlocks + * { // ImageBlock + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: { // ImageSource Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * }, + * ], * }, * assistantResponseMessage: { // AssistantResponseMessage * messageId: "STRING_VALUE", @@ -239,6 +248,13 @@ export interface SendMessageCommandOutput extends SendMessageResponse, __Metadat * content: "STRING_VALUE", // required * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", * }, + * toolUses: [ // ToolUses + * { // ToolUse + * toolUseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * input: "DOCUMENT_VALUE", // required + * }, + * ], * }, * }, * ], @@ -365,6 +381,15 @@ export interface SendMessageCommandOutput extends SendMessageResponse, __Metadat * ], * }, * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", + * origin: "STRING_VALUE", + * images: [ + * { + * format: "png" || "jpeg" || "gif" || "webp", // required + * source: {// Union: only one key present + * bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") + * }, + * }, + * ], * }, * assistantResponseMessage: { * messageId: "STRING_VALUE", @@ -391,6 +416,13 @@ export interface SendMessageCommandOutput extends SendMessageResponse, __Metadat * content: "STRING_VALUE", // required * userIntent: "SUGGEST_ALTERNATE_IMPLEMENTATION" || "APPLY_COMMON_BEST_PRACTICES" || "IMPROVE_CODE" || "SHOW_EXAMPLES" || "CITE_SOURCES" || "EXPLAIN_LINE_BY_LINE" || "EXPLAIN_CODE_SELECTION" || "GENERATE_CLOUDFORMATION_TEMPLATE" || "GENERATE_UNIT_TESTS" || "CODE_GENERATION", * }, + * toolUses: [ + * { + * toolUseId: "STRING_VALUE", // required + * name: "STRING_VALUE", // required + * input: "DOCUMENT_VALUE", // required + * }, + * ], * }, * }, * chatTriggerType: "MANUAL" || "DIAGNOSTIC" || "INLINE_CHAT", // required @@ -653,6 +685,17 @@ export interface SendMessageCommandOutput extends SendMessageResponse, __Metadat * // input: "STRING_VALUE", * // stop: true || false, * // }, + * // citationEvent: { // CitationEvent + * // target: { // CitationTarget Union: only one key present + * // location: Number("int"), + * // range: { + * // start: Number("int"), + * // end: Number("int"), + * // }, + * // }, + * // citationText: "STRING_VALUE", + * // citationLink: "STRING_VALUE", // required + * // }, * // invalidStateEvent: { // InvalidStateEvent * // reason: "INVALID_TASK_ASSIST_PLAN", // required * // message: "STRING_VALUE", // required diff --git a/src.gen/@amzn/codewhisperer-streaming/src/models/models_0.ts b/src.gen/@amzn/codewhisperer-streaming/src/models/models_0.ts index 07e2794da2d..0ed67acb7d8 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/models/models_0.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/models/models_0.ts @@ -361,7 +361,7 @@ export const FollowupPromptFilterSensitiveLog = (obj: FollowupPrompt): any => ({ }) /** - * Represents span in a text + * Represents span in a text. * @public */ export interface Span { @@ -405,19 +405,19 @@ export interface Reference { */ export interface SupplementaryWebLink { /** - * URL of the web reference link + * URL of the web reference link. * @public */ url: string | undefined; /** - * Title of the web reference link + * Title of the web reference link. * @public */ title: string | undefined; /** - * Relevant text snippet from the link + * Relevant text snippet from the link. * @public */ snippet?: string | undefined; @@ -439,6 +439,43 @@ export const SupplementaryWebLinkFilterSensitiveLog = (obj: SupplementaryWebLink }), }) +/** + * Contains information about a tool that the model is requesting be run. The model uses the result from the tool to generate a response. + * @public + */ +export interface ToolUse { + /** + * The ID for the tool request. + * @public + */ + toolUseId: string | undefined; + + /** + * The name for the tool. + * @public + */ + name: string | undefined; + + /** + * The input to pass to the tool. + * @public + */ + input: __DocumentType | undefined; +} + +/** + * @internal + */ +export const ToolUseFilterSensitiveLog = (obj: ToolUse): any => ({ + ...obj, + ...(obj.name && { name: + SENSITIVE_STRING + }), + ...(obj.input && { input: + SENSITIVE_STRING + }), +}) + /** * Markdown text message. * @public @@ -473,6 +510,12 @@ export interface AssistantResponseMessage { * @public */ followupPrompt?: FollowupPrompt | undefined; + + /** + * ToolUse Request + * @public + */ + toolUses?: (ToolUse)[] | undefined; } /** @@ -492,6 +535,12 @@ export const AssistantResponseMessageFilterSensitiveLog = (obj: AssistantRespons ...(obj.followupPrompt && { followupPrompt: FollowupPromptFilterSensitiveLog(obj.followupPrompt) }), + ...(obj.toolUses && { toolUses: + obj.toolUses.map( + item => + ToolUseFilterSensitiveLog(item) + ) + }), }) /** @@ -614,6 +663,165 @@ export const BinaryPayloadEventFilterSensitiveLog = (obj: BinaryPayloadEvent): a }), }) +/** + * @public + * @enum + */ +export const ImageFormat = { + GIF: "gif", + JPEG: "jpeg", + PNG: "png", + WEBP: "webp", +} as const +/** + * @public + */ +export type ImageFormat = typeof ImageFormat[keyof typeof ImageFormat] + +/** + * Image bytes limited to ~10MB considering overhead of base64 encoding + * @public + */ +export type ImageSource = + | ImageSource.BytesMember + | ImageSource.$UnknownMember + +/** + * @public + */ +export namespace ImageSource { + + export interface BytesMember { + bytes: Uint8Array; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + bytes?: never; + $unknown: [string, any]; + } + + export interface Visitor { + bytes: (value: Uint8Array) => T; + _: (name: string, value: any) => T; + } + + export const visit = ( + value: ImageSource, + visitor: Visitor + ): T => { + if (value.bytes !== undefined) return visitor.bytes(value.bytes); + return visitor._(value.$unknown[0], value.$unknown[1]); + } + +} +/** + * @internal + */ +export const ImageSourceFilterSensitiveLog = (obj: ImageSource): any => { + if (obj.bytes !== undefined) return {bytes: + obj.bytes + }; + if (obj.$unknown !== undefined) return {[obj.$unknown[0]]: 'UNKNOWN'}; +} + +/** + * Represents the image source itself and the format of the image. + * @public + */ +export interface ImageBlock { + format: ImageFormat | undefined; + /** + * Image bytes limited to ~10MB considering overhead of base64 encoding + * @public + */ + source: ImageSource | undefined; +} + +/** + * @internal + */ +export const ImageBlockFilterSensitiveLog = (obj: ImageBlock): any => ({ + ...obj, + ...(obj.source && { source: + SENSITIVE_STRING + }), +}) + +/** + * @public + * @enum + */ +export const Origin = { + /** + * Any AI Editor. + */ + AI_EDITOR: "AI_EDITOR", + /** + * AWS Chatbot + */ + CHATBOT: "CHATBOT", + /** + * Any CLI caller. + */ + CLI: "CLI", + /** + * AWS Management Console (https://.console.aws.amazon.com) + */ + CONSOLE: "CONSOLE", + /** + * AWS Documentation Website (https://docs.aws.amazon.com) + */ + DOCUMENTATION: "DOCUMENTATION", + /** + * Any caller from GitLab Q integration. + */ + GITLAB: "GITLAB", + /** + * Any IDE caller. + */ + IDE: "IDE", + /** + * AWS Marketing Website (https://aws.amazon.com) + */ + MARKETING: "MARKETING", + /** + * MD. + */ + MD: "MD", + /** + * AWS Mobile Application (ACMA) + */ + MOBILE: "MOBILE", + /** + * Amazon OpenSearch dashboard + */ + OPENSEARCH_DASHBOARD: "OPENSEARCH_DASHBOARD", + /** + * Amazon SageMaker's Rome Chat. + */ + SAGE_MAKER: "SAGE_MAKER", + /** + * Internal Service Traffic (Integ Tests, Canaries, etc.). This is the default when no Origin header present in request. + */ + SERVICE_INTERNAL: "SERVICE_INTERNAL", + /** + * Unified Search in AWS Management Console (https://.console.aws.amazon.com) + */ + UNIFIED_SEARCH: "UNIFIED_SEARCH", + /** + * Origin header is not set. + */ + UNKNOWN: "UNKNOWN", +} as const +/** + * @public + */ +export type Origin = typeof Origin[keyof typeof Origin] + /** * Information about the state of the AWS management console page from which the user is calling * @public @@ -1563,13 +1771,13 @@ export interface UserInputMessageContext { userSettings?: UserSettings | undefined; /** - * List of additional contextual content entries that can be included with the message + * List of additional contextual content entries that can be included with the message. * @public */ additionalContext?: (AdditionalContentEntry)[] | undefined; /** - * ToolResults for the requested ToolUses + * ToolResults for the requested ToolUses. * @public */ toolResults?: (ToolResult)[] | undefined; @@ -1628,7 +1836,7 @@ export const UserInputMessageContextFilterSensitiveLog = (obj: UserInputMessageC }) /** - * Structure to represent a chat input message from User + * Structure to represent a chat input message from User. * @public */ export interface UserInputMessage { @@ -1639,16 +1847,28 @@ export interface UserInputMessage { content: string | undefined; /** - * Chat message context associated with the Chat Message + * Chat message context associated with the Chat Message. * @public */ userInputMessageContext?: UserInputMessageContext | undefined; /** - * User Intent + * User Intent. * @public */ userIntent?: UserIntent | undefined; + + /** + * User Input Origin. + * @public + */ + origin?: Origin | undefined; + + /** + * Images associated with the Chat Message. + * @public + */ + images?: (ImageBlock)[] | undefined; } /** @@ -1662,6 +1882,12 @@ export const UserInputMessageFilterSensitiveLog = (obj: UserInputMessage): any = ...(obj.userInputMessageContext && { userInputMessageContext: UserInputMessageContextFilterSensitiveLog(obj.userInputMessageContext) }), + ...(obj.images && { images: + obj.images.map( + item => + ImageBlockFilterSensitiveLog(item) + ) + }), }) /** @@ -1678,7 +1904,7 @@ export type ChatMessage = export namespace ChatMessage { /** - * Structure to represent a chat input message from User + * Structure to represent a chat input message from User. * @public */ export interface UserInputMessageMember { @@ -1735,6 +1961,106 @@ export const ChatMessageFilterSensitiveLog = (obj: ChatMessage): any => { if (obj.$unknown !== undefined) return {[obj.$unknown[0]]: 'UNKNOWN'}; } +/** + * Represents the target of a citation event + * @public + */ +export type CitationTarget = + | CitationTarget.LocationMember + | CitationTarget.RangeMember + | CitationTarget.$UnknownMember + +/** + * @public + */ +export namespace CitationTarget { + + /** + * Represents a position in the response text where a citation should be added + * @public + */ + export interface LocationMember { + location: number; + range?: never; + $unknown?: never; + } + + /** + * Represents the range in the response text to be targetted by a citation + * @public + */ + export interface RangeMember { + location?: never; + range: Span; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + location?: never; + range?: never; + $unknown: [string, any]; + } + + export interface Visitor { + location: (value: number) => T; + range: (value: Span) => T; + _: (name: string, value: any) => T; + } + + export const visit = ( + value: CitationTarget, + visitor: Visitor + ): T => { + if (value.location !== undefined) return visitor.location(value.location); + if (value.range !== undefined) return visitor.range(value.range); + return visitor._(value.$unknown[0], value.$unknown[1]); + } + +} + +/** + * Streaming response event for citations + * @public + */ +export interface CitationEvent { + /** + * The position or the range of the response text to be cited + * @public + */ + target: CitationTarget | undefined; + + /** + * The text inside the citation '1' in [1] + * @public + */ + citationText?: string | undefined; + + /** + * The link to the document being cited + * @public + */ + citationLink: string | undefined; +} + +/** + * @internal + */ +export const CitationEventFilterSensitiveLog = (obj: CitationEvent): any => ({ + ...obj, + ...(obj.target && { target: + obj.target + }), + ...(obj.citationText && { citationText: + SENSITIVE_STRING + }), + ...(obj.citationLink && { citationLink: + SENSITIVE_STRING + }), +}) + /** * Streaming response event for generated code text. * @public @@ -3073,6 +3399,7 @@ export const ToolUseEventFilterSensitiveLog = (obj: ToolUseEvent): any => ({ */ export type ChatResponseStream = | ChatResponseStream.AssistantResponseEventMember + | ChatResponseStream.CitationEventMember | ChatResponseStream.CodeEventMember | ChatResponseStream.CodeReferenceEventMember | ChatResponseStream.DryRunSucceedEventMember @@ -3106,6 +3433,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3126,6 +3454,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3146,6 +3475,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3166,6 +3496,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3186,6 +3517,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3206,6 +3538,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3226,6 +3559,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3246,6 +3580,7 @@ export namespace ChatResponseStream { intentsEvent: IntentsEvent; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3266,6 +3601,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent: InteractionComponentsEvent; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3286,6 +3622,28 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent: ToolUseEvent; + citationEvent?: never; + invalidStateEvent?: never; + error?: never; + $unknown?: never; + } + + /** + * Citation event + * @public + */ + export interface CitationEventMember { + messageMetadataEvent?: never; + assistantResponseEvent?: never; + dryRunSucceedEvent?: never; + codeReferenceEvent?: never; + supplementaryWebLinksEvent?: never; + followupPromptEvent?: never; + codeEvent?: never; + intentsEvent?: never; + interactionComponentsEvent?: never; + toolUseEvent?: never; + citationEvent: CitationEvent; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3306,6 +3664,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent: InvalidStateEvent; error?: never; $unknown?: never; @@ -3326,6 +3685,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error: InternalServerException; $unknown?: never; @@ -3345,6 +3705,7 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; + citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown: [string, any]; @@ -3361,6 +3722,7 @@ export namespace ChatResponseStream { intentsEvent: (value: IntentsEvent) => T; interactionComponentsEvent: (value: InteractionComponentsEvent) => T; toolUseEvent: (value: ToolUseEvent) => T; + citationEvent: (value: CitationEvent) => T; invalidStateEvent: (value: InvalidStateEvent) => T; error: (value: InternalServerException) => T; _: (name: string, value: any) => T; @@ -3380,6 +3742,7 @@ export namespace ChatResponseStream { if (value.intentsEvent !== undefined) return visitor.intentsEvent(value.intentsEvent); if (value.interactionComponentsEvent !== undefined) return visitor.interactionComponentsEvent(value.interactionComponentsEvent); if (value.toolUseEvent !== undefined) return visitor.toolUseEvent(value.toolUseEvent); + if (value.citationEvent !== undefined) return visitor.citationEvent(value.citationEvent); if (value.invalidStateEvent !== undefined) return visitor.invalidStateEvent(value.invalidStateEvent); if (value.error !== undefined) return visitor.error(value.error); return visitor._(value.$unknown[0], value.$unknown[1]); @@ -3420,6 +3783,9 @@ export const ChatResponseStreamFilterSensitiveLog = (obj: ChatResponseStream): a if (obj.toolUseEvent !== undefined) return {toolUseEvent: ToolUseEventFilterSensitiveLog(obj.toolUseEvent) }; + if (obj.citationEvent !== undefined) return {citationEvent: + CitationEventFilterSensitiveLog(obj.citationEvent) + }; if (obj.invalidStateEvent !== undefined) return {invalidStateEvent: obj.invalidStateEvent }; @@ -3860,6 +4226,8 @@ export interface ExportResultArchiveRequest { * @public */ exportContext?: ExportContext | undefined; + + profileArn?: string | undefined; } /** @@ -3884,61 +4252,6 @@ export const ExportResultArchiveResponseFilterSensitiveLog = (obj: ExportResultA }), }) -/** - * @public - * @enum - */ -export const Origin = { - /** - * AWS Chatbot - */ - CHATBOT: "CHATBOT", - /** - * AWS Management Console (https://.console.aws.amazon.com) - */ - CONSOLE: "CONSOLE", - /** - * AWS Documentation Website (https://docs.aws.amazon.com) - */ - DOCUMENTATION: "DOCUMENTATION", - /** - * Any IDE caller. - */ - IDE: "IDE", - /** - * AWS Marketing Website (https://aws.amazon.com) - */ - MARKETING: "MARKETING", - /** - * MD. - */ - MD: "MD", - /** - * AWS Mobile Application (ACMA) - */ - MOBILE: "MOBILE", - /** - * Amazon SageMaker's Rome Chat. - */ - SAGE_MAKER: "SAGE_MAKER", - /** - * Internal Service Traffic (Integ Tests, Canaries, etc.). This is the default when no Origin header present in request. - */ - SERVICE_INTERNAL: "SERVICE_INTERNAL", - /** - * Unified Search in AWS Management Console (https://.console.aws.amazon.com) - */ - UNIFIED_SEARCH: "UNIFIED_SEARCH", - /** - * Origin header is not set. - */ - UNKNOWN: "UNKNOWN", -} as const -/** - * @public - */ -export type Origin = typeof Origin[keyof typeof Origin] - /** * Structure to represent a SendMessage request. * @public @@ -4008,6 +4321,8 @@ export interface GenerateTaskAssistPlanRequest { * @public */ workspaceState: WorkspaceState | undefined; + + profileArn?: string | undefined; } /** diff --git a/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts b/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts index 252aa8f3e43..529fb5b1798 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts @@ -26,6 +26,7 @@ import { BinaryPayloadEvent, ChatMessage, ChatResponseStream, + CitationEvent, CodeEvent, CodeReferenceEvent, ConflictException, @@ -43,6 +44,8 @@ import { FollowupPrompt, FollowupPromptEvent, GitState, + ImageBlock, + ImageSource, IntentsEvent, InteractionComponent, InteractionComponentEntry, @@ -72,6 +75,7 @@ import { ToolResult, ToolResultContentBlock, ToolSpecification, + ToolUse, ToolUseEvent, TransformationExportContext, UnitTestGenerationExportContext, @@ -126,6 +130,7 @@ export const se_ExportResultArchiveCommand = async( 'exportContext': _ => _json(_), 'exportId': [], 'exportIntent': [], + 'profileArn': [], })); b.m("POST") .h(headers) @@ -171,6 +176,7 @@ export const se_GenerateTaskAssistPlanCommand = async( let body: any; body = JSON.stringify(take(input, { 'conversationState': _ => se_ConversationState(_, context), + 'profileArn': [], 'workspaceState': _ => _json(_), })); b.m("POST") @@ -557,6 +563,11 @@ const de_CommandError = async( toolUseEvent: await de_ToolUseEvent_event(event["toolUseEvent"], context), }; } + if (event["citationEvent"] != null) { + return { + citationEvent: await de_CitationEvent_event(event["citationEvent"], context), + }; + } if (event["invalidStateEvent"] != null) { return { invalidStateEvent: await de_InvalidStateEvent_event(event["invalidStateEvent"], context), @@ -627,6 +638,15 @@ const de_CommandError = async( Object.assign(contents, de_BinaryPayloadEvent(data, context)); return contents; } + const de_CitationEvent_event = async ( + output: any, + context: __SerdeContext + ): Promise => { + const contents: CitationEvent = {} as any; + const data: any = await parseBody(output.body, context); + Object.assign(contents, _json(data)); + return contents; + } const de_CodeEvent_event = async ( output: any, context: __SerdeContext @@ -733,7 +753,22 @@ const de_CommandError = async( // se_AppStudioState omitted. - // se_AssistantResponseMessage omitted. + /** + * serializeAws_restJson1AssistantResponseMessage + */ + const se_AssistantResponseMessage = ( + input: AssistantResponseMessage, + context: __SerdeContext + ): any => { + return take(input, { + 'content': [], + 'followupPrompt': _json, + 'messageId': [], + 'references': _json, + 'supplementaryWebLinks': _json, + 'toolUses': _ => se_ToolUses(_, context), + }); + } /** * serializeAws_restJson1ChatHistory @@ -755,7 +790,7 @@ const de_CommandError = async( context: __SerdeContext ): any => { return ChatMessage.visit(input, { - assistantResponseMessage: value => ({ "assistantResponseMessage": _json(value) }), + assistantResponseMessage: value => ({ "assistantResponseMessage": se_AssistantResponseMessage(value, context) }), userInputMessage: value => ({ "userInputMessage": se_UserInputMessage(value, context) }), _: (name, value) => ({ name: value } as any) }); @@ -801,6 +836,44 @@ const de_CommandError = async( // se_GitState omitted. + /** + * serializeAws_restJson1ImageBlock + */ + const se_ImageBlock = ( + input: ImageBlock, + context: __SerdeContext + ): any => { + return take(input, { + 'format': [], + 'source': _ => se_ImageSource(_, context), + }); + } + + /** + * serializeAws_restJson1ImageBlocks + */ + const se_ImageBlocks = ( + input: (ImageBlock)[], + context: __SerdeContext + ): any => { + return input.filter((e: any) => e != null).map(entry => { + return se_ImageBlock(entry, context); + }); + } + + /** + * serializeAws_restJson1ImageSource + */ + const se_ImageSource = ( + input: ImageSource, + context: __SerdeContext + ): any => { + return ImageSource.visit(input, { + bytes: value => ({ "bytes": context.base64Encoder(value) }), + _: (name, value) => ({ name: value } as any) + }); + } + // se_Position omitted. // se_ProgrammingLanguage omitted. @@ -946,6 +1019,32 @@ const de_CommandError = async( }); } + /** + * serializeAws_restJson1ToolUse + */ + const se_ToolUse = ( + input: ToolUse, + context: __SerdeContext + ): any => { + return take(input, { + 'input': _ => se_SensitiveDocument(_, context), + 'name': [], + 'toolUseId': [], + }); + } + + /** + * serializeAws_restJson1ToolUses + */ + const se_ToolUses = ( + input: (ToolUse)[], + context: __SerdeContext + ): any => { + return input.filter((e: any) => e != null).map(entry => { + return se_ToolUse(entry, context); + }); + } + // se_TransformationExportContext omitted. // se_UnitTestGenerationExportContext omitted. @@ -959,6 +1058,8 @@ const de_CommandError = async( ): any => { return take(input, { 'content': [], + 'images': _ => se_ImageBlocks(_, context), + 'origin': [], 'userInputMessageContext': _ => se_UserInputMessageContext(_, context), 'userIntent': [], }); @@ -1006,6 +1107,10 @@ const de_CommandError = async( }) as any; } + // de_CitationEvent omitted. + + // de_CitationTarget omitted. + // de_CodeEvent omitted. // de_CodeReferenceEvent omitted. From 74e8f8a374c48b508cf29800e667f6d98baf30be Mon Sep 17 00:00:00 2001 From: Ashish Reddy Podduturi Date: Wed, 19 Mar 2025 16:44:46 -0700 Subject: [PATCH 2/2] Removing origin IDE from converter --- .../codewhispererChat/controllers/chat/chatRequest/converter.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts b/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts index 0bd0d32791e..0a34463058e 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts @@ -119,7 +119,6 @@ export function triggerPayloadToChatRequest(triggerPayload: TriggerPayload): { c additionalContext: triggerPayload.additionalContents, }, userIntent: triggerPayload.userIntent, - origin: 'IDE', }, }, chatTriggerType,