From 77643cff86f66b54a1a5cb9688724447bbc78d9c Mon Sep 17 00:00:00 2001 From: Ashish Reddy Podduturi Date: Wed, 19 Mar 2025 13:40:16 -0700 Subject: [PATCH 1/2] Added chat history storage to the Q chat for agentic chat --- .../codewhisperer/client/user-service-2.json | 717 +++++++++++++++++- .../codewhispererChat/clients/chat/v0/chat.ts | 4 - .../controllers/chat/chatRequest/converter.ts | 2 + .../controllers/chat/controller.ts | 47 +- .../controllers/chat/messenger/messenger.ts | 13 +- .../controllers/chat/model.ts | 3 +- .../codewhispererChat/storages/chatHistory.ts | 118 +++ .../@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 ++- 14 files changed, 1522 insertions(+), 123 deletions(-) create mode 100644 packages/core/src/codewhispererChat/storages/chatHistory.ts 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/clients/chat/v0/chat.ts b/packages/core/src/codewhispererChat/clients/chat/v0/chat.ts index 3cf030b9b8e..540135268e0 100644 --- a/packages/core/src/codewhispererChat/clients/chat/v0/chat.ts +++ b/packages/core/src/codewhispererChat/clients/chat/v0/chat.ts @@ -60,10 +60,6 @@ export class ChatSession { async chatSso(chatRequest: GenerateAssistantResponseRequest): Promise { const client = await createCodeWhispererChatStreamingClient() - if (this.sessionId !== undefined && chatRequest.conversationState !== undefined) { - chatRequest.conversationState.conversationId = this.sessionId - } - const response = await client.generateAssistantResponse(chatRequest) if (!response.generateAssistantResponseResponse) { throw new ToolkitError( diff --git a/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts b/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts index 0a34463058e..49c77788255 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/chatRequest/converter.ts @@ -119,10 +119,12 @@ export function triggerPayloadToChatRequest(triggerPayload: TriggerPayload): { c additionalContext: triggerPayload.additionalContents, }, userIntent: triggerPayload.userIntent, + origin: 'IDE', }, }, chatTriggerType, customizationArn: customizationArn, + history: triggerPayload.chatHistory, }, } } diff --git a/packages/core/src/codewhispererChat/controllers/chat/controller.ts b/packages/core/src/codewhispererChat/controllers/chat/controller.ts index 846f3c6e445..667c3d418f6 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/controller.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/controller.ts @@ -80,6 +80,7 @@ import { contextMaxLength, } from '../../constants' import { ChatSession } from '../../clients/chat/v0/chat' +import { ChatHistoryManager } from '../../storages/chatHistory' export interface ChatControllerMessagePublishers { readonly processPromptChatMessage: MessagePublisher @@ -141,6 +142,7 @@ export class ChatController { private readonly userIntentRecognizer: UserIntentRecognizer private readonly telemetryHelper: CWCTelemetryHelper private userPromptsWatcher: vscode.FileSystemWatcher | undefined + private readonly chatHistoryManager: ChatHistoryManager public constructor( private readonly chatControllerMessageListeners: ChatControllerMessageListeners, @@ -158,6 +160,7 @@ export class ChatController { this.editorContentController = new EditorContentController() this.promptGenerator = new PromptsGenerator() this.userIntentRecognizer = new UserIntentRecognizer() + this.chatHistoryManager = new ChatHistoryManager() onDidChangeAmazonQVisibility((visible) => { if (visible) { @@ -395,6 +398,7 @@ export class ChatController { private async processTabCloseMessage(message: TabClosedMessage) { this.sessionStorage.deleteSession(message.tabID) + this.chatHistoryManager.clear() this.triggerEventsStorage.removeTabEvents(message.tabID) // this.telemetryHelper.recordCloseChat(message.tabID) } @@ -654,6 +658,7 @@ export class ChatController { getLogger().error(`error: ${errorMessage} tabID: ${tabID} requestID: ${requestID}`) this.sessionStorage.deleteSession(tabID) + this.chatHistoryManager.clear() } private async processContextMenuCommand(command: EditorContextCommand) { @@ -714,6 +719,13 @@ export class ChatController { command, }) + this.chatHistoryManager.appendUserMessage({ + userInputMessage: { + content: prompt, + userIntent: this.userIntentRecognizer.getFromContextMenuCommand(command), + }, + }) + return this.generateResponse( { message: prompt, @@ -727,6 +739,7 @@ export class ChatController { codeQuery: context?.focusAreaContext?.names, userIntent: this.userIntentRecognizer.getFromContextMenuCommand(command), customization: getSelectedCustomization(), + chatHistory: this.chatHistoryManager.getHistory(), }, triggerID ) @@ -766,6 +779,7 @@ export class ChatController { switch (message.command) { case 'clear': this.sessionStorage.deleteSession(message.tabID) + this.chatHistoryManager.clear() this.triggerEventsStorage.removeTabEvents(message.tabID) recordTelemetryChatRunCommand('clear') return @@ -791,6 +805,13 @@ export class ChatController { context: lastTriggerEvent.context, }) + this.chatHistoryManager.appendUserMessage({ + userInputMessage: { + content: message.message, + userIntent: message.userIntent, + }, + }) + return this.generateResponse( { message: message.message, @@ -804,6 +825,7 @@ export class ChatController { codeQuery: lastTriggerEvent.context?.focusAreaContext?.names, userIntent: message.userIntent, customization: getSelectedCustomization(), + chatHistory: this.chatHistoryManager.getHistory(), }, triggerID ) @@ -824,6 +846,12 @@ export class ChatController { type: 'chat_message', context, }) + this.chatHistoryManager.appendUserMessage({ + userInputMessage: { + content: message.message, + userIntent: message.userIntent, + }, + }) return this.generateResponse( { message: message.message, @@ -838,6 +866,7 @@ export class ChatController { userIntent: this.userIntentRecognizer.getFromPromptChatMessage(message), customization: getSelectedCustomization(), context: message.context, + chatHistory: this.chatHistoryManager.getHistory(), }, triggerID ) @@ -1104,6 +1133,15 @@ export class ChatController { triggerPayload.documentReferences = this.mergeRelevantTextDocuments(triggerPayload.relevantTextDocuments || []) const request = triggerPayloadToChatRequest(triggerPayload) + if ( + this.chatHistoryManager.getConversationId() !== undefined && + this.chatHistoryManager.getConversationId() !== '' + ) { + request.conversationState.conversationId = this.chatHistoryManager.getConversationId() + } else { + this.chatHistoryManager.setConversationId(randomUUID()) + request.conversationState.conversationId = this.chatHistoryManager.getConversationId() + } if (triggerPayload.documentReferences !== undefined) { const relativePathsOfMergedRelevantDocuments = triggerPayload.documentReferences.map( @@ -1157,7 +1195,14 @@ export class ChatController { response.$metadata.requestId } metadata: ${inspect(response.$metadata, { depth: 12 })}` ) - await this.messenger.sendAIResponse(response, session, tabID, triggerID, triggerPayload) + await this.messenger.sendAIResponse( + response, + session, + tabID, + triggerID, + triggerPayload, + this.chatHistoryManager + ) } catch (e: any) { this.telemetryHelper.recordMessageResponseError(triggerPayload, tabID, getHttpStatusCode(e) ?? 0) // clears session, record telemetry before this call diff --git a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts index dd80676cf8b..3c5f181a3fb 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts @@ -38,6 +38,7 @@ import { extractCodeBlockLanguage } from '../../../../shared/markdown' import { extractAuthFollowUp } from '../../../../amazonq/util/authUtils' import { helpMessage } from '../../../../amazonq/webview/ui/texts/constants' import { ChatItemButton, ChatItemFormItem, MynahUIDataModel } from '@aws/mynah-ui' +import { ChatHistoryManager } from '../../../storages/chatHistory' export type StaticTextResponseType = 'quick-action-help' | 'onboarding-help' | 'transform' | 'help' @@ -121,7 +122,8 @@ export class Messenger { session: ChatSession, tabID: string, triggerID: string, - triggerPayload: TriggerPayload + triggerPayload: TriggerPayload, + chatHistoryManager: ChatHistoryManager ) { let message = '' const messageID = response.$metadata.requestId ?? '' @@ -331,6 +333,15 @@ export class Messenger { ) ) + chatHistoryManager.pushAssistantMessage({ + assistantResponseMessage: { + messageId: messageID, + content: message, + references: codeReference, + // TODO: Add tools data and follow up prompt details + }, + }) + getLogger().info( `All events received. requestId=%s counts=%s`, response.$metadata.requestId, diff --git a/packages/core/src/codewhispererChat/controllers/chat/model.ts b/packages/core/src/codewhispererChat/controllers/chat/model.ts index ae0c6b61063..62666316166 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/model.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/model.ts @@ -4,7 +4,7 @@ */ import * as vscode from 'vscode' -import { AdditionalContentEntry, RelevantTextDocument, UserIntent } from '@amzn/codewhisperer-streaming' +import { AdditionalContentEntry, ChatMessage, RelevantTextDocument, UserIntent } from '@amzn/codewhisperer-streaming' import { MatchPolicy, CodeQuery } from '../../clients/chat/v0/model' import { Selection } from 'vscode' import { TabOpenType } from '../../../amazonq/webview/ui/storages/tabsStorage' @@ -197,6 +197,7 @@ export interface TriggerPayload { additionalContextLengths?: AdditionalContextLengths truncatedAdditionalContextLengths?: AdditionalContextLengths workspaceRulesCount?: number + chatHistory?: ChatMessage[] } export type AdditionalContextLengths = { diff --git a/packages/core/src/codewhispererChat/storages/chatHistory.ts b/packages/core/src/codewhispererChat/storages/chatHistory.ts new file mode 100644 index 00000000000..5387a36ed09 --- /dev/null +++ b/packages/core/src/codewhispererChat/storages/chatHistory.ts @@ -0,0 +1,118 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import { ChatMessage } from '@amzn/codewhisperer-streaming' +import { randomUUID } from '../../shared/crypto' +import { getLogger } from '../../shared/logger/logger' + +// Maximum number of messages to keep in history +const MaxConversationHistoryLength = 100 + +/** + * ChatHistoryManager handles the storage and manipulation of chat history + * for CodeWhisperer Chat sessions. + */ +export class ChatHistoryManager { + private conversationId: string + private history: ChatMessage[] = [] + private logger = getLogger() + private lastUserMessage?: ChatMessage + + constructor() { + this.conversationId = randomUUID() + this.logger.info(`Generated new conversation id: ${this.conversationId}`) + } + + /** + * Get the conversation ID + */ + public getConversationId(): string { + return this.conversationId + } + + public setConversationId(conversationId: string) { + this.conversationId = conversationId + } + + /** + * Get the full chat history + */ + public getHistory(): ChatMessage[] { + return [...this.history] + } + + /** + * Clear the conversation history + */ + public clear(): void { + this.history = [] + this.conversationId = '' + } + + /** + * Append a new user message to be sent + */ + public appendUserMessage(newMessage: ChatMessage): void { + this.fixHistory() + if (!newMessage.userInputMessage?.content || newMessage.userInputMessage?.content.trim() === '') { + this.logger.warn('input must not be empty when adding new messages') + // const emptyMessage: ChatMessage = { + // ...newMessage, + // userInputMessage: { + // ...newMessage.userInputMessage, + // content: 'Empty user input', + // }, + // } + // this.history.push(emptyMessage) + } + this.lastUserMessage = newMessage + this.history.push(newMessage) + } + + /** + * Push an assistant message to the history + */ + public pushAssistantMessage(newMessage: ChatMessage): void { + if (newMessage !== undefined && this.lastUserMessage !== undefined) { + this.logger.warn('last Message should not be defined when pushing an assistant message') + } + this.history.push(newMessage) + } + + /** + * Fixes the history to maintain the following invariants: + * 1. The history length is <= MAX_CONVERSATION_HISTORY_LENGTH. Oldest messages are dropped. + * 2. The first message is from the user. Oldest messages are dropped if needed. + * 3. The last message is from the assistant. The last message is dropped if it is from the user. + * 4. If the last message is from the assistant and it contains tool uses, and a next user + * message is set without tool results, then the user message will have cancelled tool results. + */ + public fixHistory(): void { + // Trim the conversation history if it exceeds the maximum length + if (this.history.length > MaxConversationHistoryLength) { + // Find the second oldest user message to be the new starting point + const secondUserMessageIndex = this.history + .slice(1) // Skip the first message which might be from the user + .findIndex((msg) => !msg.userInputMessage?.content || msg.userInputMessage?.content.trim() === '') + + if (secondUserMessageIndex !== -1) { + // +1 because we sliced off the first element + this.logger.debug(`Removing the first ${secondUserMessageIndex + 1} elements in the history`) + this.history = this.history.slice(secondUserMessageIndex + 1) + } else { + this.logger.debug('No valid starting user message found in the history, clearing') + this.history = [] + } + } + + // Ensure the last message is from the assistant + + if (this.history.length > 0 && this.history[this.history.length - 1].userInputMessage !== undefined) { + this.logger.debug('Last message in history is from the user, dropping') + this.history.pop() + } + + // TODO: If the last message from the assistant contains tool uses, ensure the next user message contains tool results + } +} 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 731e940db677ba1747b186c105d08ed8bd88dc6f Mon Sep 17 00:00:00 2001 From: Ashish Reddy Podduturi Date: Wed, 19 Mar 2025 15:47:35 -0700 Subject: [PATCH 2/2] Revert for model changes in "Added chat history storage to the Q chat for 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, 116 insertions(+), 1343 deletions(-) diff --git a/packages/core/src/codewhisperer/client/user-service-2.json b/packages/core/src/codewhisperer/client/user-service-2.json index 986b4d465b0..ed7661bec4c 100644 --- a/packages/core/src/codewhisperer/client/user-service-2.json +++ b/packages/core/src/codewhisperer/client/user-service-2.json @@ -66,23 +66,6 @@ "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": { @@ -100,22 +83,6 @@ ], "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": { @@ -248,21 +215,6 @@ { "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": { @@ -296,22 +248,6 @@ ], "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": { @@ -468,57 +404,6 @@ "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"], @@ -566,20 +451,6 @@ "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, @@ -617,17 +488,13 @@ "followupPrompt": { "shape": "FollowupPrompt", "documentation": "

Followup Prompt

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

ToolUse Request

" } }, "documentation": "

Markdown text message.

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

Indicates Participant in Chat conversation

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

Structure to represent bootstrap conversation request.

" }, "CreateTaskAssistConversationResponse": { @@ -1037,8 +889,7 @@ "artifactType": { "shape": "ArtifactType" }, "uploadIntent": { "shape": "UploadIntent" }, "uploadContext": { "shape": "UploadContext" }, - "uploadId": { "shape": "UploadId" }, - "profileArn": { "shape": "ProfileArn" } + "uploadId": { "shape": "UploadId" } } }, "CreateUploadUrlRequestContentChecksumString": { @@ -1068,26 +919,6 @@ "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": { @@ -1128,19 +959,11 @@ "type": "list", "member": { "shape": "Customization" } }, - "DashboardAnalytics": { - "type": "structure", - "required": ["toggle"], - "members": { - "toggle": { "shape": "OptInFeatureToggle" } - } - }, "DeleteTaskAssistConversationRequest": { "type": "structure", "required": ["conversationId"], "members": { - "conversationId": { "shape": "ConversationId" }, - "profileArn": { "shape": "ProfileArn" } + "conversationId": { "shape": "ConversationId" } }, "documentation": "

Structure to represent bootstrap conversation request.

" }, @@ -1152,18 +975,6 @@ }, "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, @@ -1471,19 +1282,6 @@ "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"], @@ -1620,20 +1418,6 @@ "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"], @@ -1646,8 +1430,7 @@ "customizationArn": { "shape": "CustomizationArn" }, "optOutPreference": { "shape": "OptOutPreference" }, "userContext": { "shape": "UserContext" }, - "profileArn": { "shape": "ProfileArn" }, - "workspaceId": { "shape": "UUID" } + "profileArn": { "shape": "ProfileArn" } } }, "GenerateCompletionsRequestMaxResultsInteger": { @@ -1674,8 +1457,7 @@ "type": "structure", "required": ["jobId"], "members": { - "jobId": { "shape": "GetCodeAnalysisRequestJobIdString" }, - "profileArn": { "shape": "ProfileArn" } + "jobId": { "shape": "GetCodeAnalysisRequestJobIdString" } } }, "GetCodeAnalysisRequestJobIdString": { @@ -1695,8 +1477,7 @@ "type": "structure", "required": ["jobId"], "members": { - "jobId": { "shape": "GetCodeFixJobRequestJobIdString" }, - "profileArn": { "shape": "ProfileArn" } + "jobId": { "shape": "GetCodeFixJobRequestJobIdString" } } }, "GetCodeFixJobRequestJobIdString": { @@ -1717,8 +1498,7 @@ "required": ["conversationId", "codeGenerationId"], "members": { "conversationId": { "shape": "ConversationId" }, - "codeGenerationId": { "shape": "CodeGenerationId" }, - "profileArn": { "shape": "ProfileArn" } + "codeGenerationId": { "shape": "CodeGenerationId" } }, "documentation": "

Request for getting task assist code generation.

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

Structure to represent get test generation request.

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

Structure to represent get code transformation plan request.

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

Structure to represent get code transformation request.

" }, @@ -1812,47 +1589,6 @@ "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": { @@ -1920,11 +1656,6 @@ "fault": true, "retryable": { "throttling": false } }, - "IssuerUrl": { - "type": "string", - "max": 255, - "min": 1 - }, "LineRangeList": { "type": "list", "member": { "shape": "Range" } @@ -1933,8 +1664,7 @@ "type": "structure", "members": { "maxResults": { "shape": "ListAvailableCustomizationsRequestMaxResultsInteger" }, - "nextToken": { "shape": "Base64EncodedPaginationToken" }, - "profileArn": { "shape": "ProfileArn" } + "nextToken": { "shape": "Base64EncodedPaginationToken" } } }, "ListAvailableCustomizationsRequestMaxResultsInteger": { @@ -1951,35 +1681,13 @@ "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" }, - "profileArn": { "shape": "ProfileArn" } + "codeAnalysisFindingsSchema": { "shape": "CodeAnalysisFindingsSchema" } } }, "ListCodeAnalysisFindingsRequestJobIdString": { @@ -1999,8 +1707,7 @@ "type": "structure", "required": ["userContext"], "members": { - "userContext": { "shape": "UserContext" }, - "profileArn": { "shape": "ProfileArn" } + "userContext": { "shape": "UserContext" } } }, "ListFeatureEvaluationsResponse": { @@ -2010,29 +1717,6 @@ "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 @@ -2066,65 +1750,16 @@ "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": { @@ -2186,56 +1821,12 @@ "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"], @@ -2254,14 +1845,6 @@ "type": "list", "member": { "shape": "TransformationProgressUpdate" } }, - "PromptLogging": { - "type": "structure", - "required": ["s3Uri", "toggle"], - "members": { - "s3Uri": { "shape": "S3Uri" }, - "toggle": { "shape": "OptInFeatureToggle" } - } - }, "Range": { "type": "structure", "required": ["start", "end"], @@ -2335,7 +1918,7 @@ "RelevantDocumentList": { "type": "list", "member": { "shape": "RelevantTextDocument" }, - "max": 30, + "max": 5, "min": 0 }, "RelevantTextDocument": { @@ -2369,7 +1952,7 @@ }, "RelevantTextDocumentTextString": { "type": "string", - "max": 40960, + "max": 10240, "min": 0, "sensitive": true }, @@ -2406,24 +1989,12 @@ "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" }, - "profileArn": { "shape": "ProfileArn" } + "userActionStatus": { "shape": "TransformationUserActionStatus" } }, "documentation": "

Structure to represent stop code transformation request.

" }, @@ -2466,27 +2037,6 @@ "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", @@ -2632,8 +2176,7 @@ "idempotencyToken": true }, "scope": { "shape": "CodeAnalysisScope" }, - "codeScanName": { "shape": "CodeScanName" }, - "profileArn": { "shape": "ProfileArn" } + "codeScanName": { "shape": "CodeScanName" } } }, "StartCodeAnalysisRequestClientTokenString": { @@ -2663,9 +2206,7 @@ "uploadId": { "shape": "UploadId" }, "description": { "shape": "StartCodeFixJobRequestDescriptionString" }, "ruleId": { "shape": "StartCodeFixJobRequestRuleIdString" }, - "codeFixName": { "shape": "CodeFixName" }, - "referenceTrackerConfiguration": { "shape": "ReferenceTrackerConfiguration" }, - "profileArn": { "shape": "ProfileArn" } + "codeFixName": { "shape": "CodeFixName" } } }, "StartCodeFixJobRequestDescriptionString": { @@ -2703,8 +2244,7 @@ "codeGenerationId": { "shape": "CodeGenerationId" }, "currentCodeGenerationId": { "shape": "CodeGenerationId" }, "intent": { "shape": "Intent" }, - "intentContext": { "shape": "IntentContext" }, - "profileArn": { "shape": "ProfileArn" } + "intentContext": { "shape": "IntentContext" } }, "documentation": "

Structure to represent start code generation request.

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

Structure to represent test generation request.

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

Structure to represent code transformation request.

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

Structure to represent stop code transformation request.

" }, @@ -2852,15 +2388,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

" @@ -3047,11 +2583,6 @@ }, "union": true }, - "TenantId": { - "type": "string", - "max": 1024, - "min": 1 - }, "TerminalUserInteractionEvent": { "type": "structure", "members": { @@ -3198,7 +2729,7 @@ }, "TextDocumentTextString": { "type": "string", - "max": 40000, + "max": 10240, "min": 0, "sensitive": true }, @@ -3219,124 +2750,6 @@ "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"], @@ -3553,8 +2966,7 @@ "taskAssistPlanningUploadContext": { "shape": "TaskAssistPlanningUploadContext" }, "transformationUploadContext": { "shape": "TransformationUploadContext" }, "codeAnalysisUploadContext": { "shape": "CodeAnalysisUploadContext" }, - "codeFixUploadContext": { "shape": "CodeFixUploadContext" }, - "workspaceContextUploadContext": { "shape": "WorkspaceContextUploadContext" } + "codeFixUploadContext": { "shape": "CodeFixUploadContext" } }, "union": true }, @@ -3573,15 +2985,9 @@ "AUTOMATIC_FILE_SECURITY_SCAN", "FULL_PROJECT_SECURITY_SCAN", "UNIT_TESTS_GENERATION", - "CODE_FIX_GENERATION", - "WORKSPACE_CONTEXT" + "CODE_FIX_GENERATION" ] }, - "Url": { - "type": "string", - "max": 1024, - "min": 1 - }, "UserContext": { "type": "structure", "required": ["ideCategory", "operatingSystem", "product"], @@ -3609,26 +3015,18 @@ }, "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.

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

User Input Origin.

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

Images associated with the Chat Message.

" + "documentation": "

User Intent

" } }, - "documentation": "

Structure to represent a chat input message from User.

" + "documentation": "

Structure to represent a chat input message from User

" }, "UserInputMessageContentString": { "type": "string", - "max": 600000, + "max": 4096, "min": 0, "sensitive": true }, @@ -3666,18 +3064,6 @@ "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

" @@ -3770,35 +3156,6 @@ "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"], @@ -3818,10 +3175,6 @@ }, "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 49c77788255..dd6edfbeff0 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, diff --git a/src.gen/@amzn/codewhisperer-streaming/README.md b/src.gen/@amzn/codewhisperer-streaming/README.md index ea254be0911..5f5df60669d 100644 --- a/src.gen/@amzn/codewhisperer-streaming/README.md +++ b/src.gen/@amzn/codewhisperer-streaming/README.md @@ -227,6 +227,13 @@ 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 @@ -297,6 +304,13 @@ 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 @@ -353,13 +367,6 @@ 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 @@ -367,13 +374,6 @@ 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,13 +451,6 @@ 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 @@ -577,13 +570,6 @@ 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 @@ -773,20 +759,6 @@ 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 c2376564160..8b8a5016715 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/ExportResultArchiveCommand.ts @@ -56,7 +56,6 @@ 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 93692022f1d..4bfdeb6aa74 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateAssistantResponseCommand.ts @@ -212,15 +212,6 @@ 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", @@ -247,13 +238,6 @@ 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 - * }, - * ], * }, * }, * ], @@ -380,15 +364,6 @@ 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", @@ -415,13 +390,6 @@ 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 @@ -683,17 +651,6 @@ 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 aabf5ec6a55..ef188a0600a 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/GenerateTaskAssistPlanCommand.ts @@ -212,15 +212,6 @@ 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", @@ -247,13 +238,6 @@ 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 - * }, - * ], * }, * }, * ], @@ -380,15 +364,6 @@ 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", @@ -415,13 +390,6 @@ 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 @@ -432,7 +400,6 @@ export interface GenerateTaskAssistPlanCommandOutput extends GenerateTaskAssistP * programmingLanguage: "", // required * contextTruncationScheme: "ANALYSIS" || "GUMBY", * }, - * profileArn: "STRING_VALUE", * }; * const command = new GenerateTaskAssistPlanCommand(input); * const response = await client.send(command); @@ -687,17 +654,6 @@ 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 c040041719c..8a83024b54d 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/commands/SendMessageCommand.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/commands/SendMessageCommand.ts @@ -213,15 +213,6 @@ 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", @@ -248,13 +239,6 @@ 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 - * }, - * ], * }, * }, * ], @@ -381,15 +365,6 @@ 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", @@ -416,13 +391,6 @@ 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 @@ -685,17 +653,6 @@ 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 0ed67acb7d8..07e2794da2d 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,43 +439,6 @@ 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 @@ -510,12 +473,6 @@ export interface AssistantResponseMessage { * @public */ followupPrompt?: FollowupPrompt | undefined; - - /** - * ToolUse Request - * @public - */ - toolUses?: (ToolUse)[] | undefined; } /** @@ -535,12 +492,6 @@ export const AssistantResponseMessageFilterSensitiveLog = (obj: AssistantRespons ...(obj.followupPrompt && { followupPrompt: FollowupPromptFilterSensitiveLog(obj.followupPrompt) }), - ...(obj.toolUses && { toolUses: - obj.toolUses.map( - item => - ToolUseFilterSensitiveLog(item) - ) - }), }) /** @@ -663,165 +614,6 @@ 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 @@ -1771,13 +1563,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; @@ -1836,7 +1628,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 { @@ -1847,28 +1639,16 @@ 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; } /** @@ -1882,12 +1662,6 @@ export const UserInputMessageFilterSensitiveLog = (obj: UserInputMessage): any = ...(obj.userInputMessageContext && { userInputMessageContext: UserInputMessageContextFilterSensitiveLog(obj.userInputMessageContext) }), - ...(obj.images && { images: - obj.images.map( - item => - ImageBlockFilterSensitiveLog(item) - ) - }), }) /** @@ -1904,7 +1678,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 { @@ -1961,106 +1735,6 @@ 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 @@ -3399,7 +3073,6 @@ export const ToolUseEventFilterSensitiveLog = (obj: ToolUseEvent): any => ({ */ export type ChatResponseStream = | ChatResponseStream.AssistantResponseEventMember - | ChatResponseStream.CitationEventMember | ChatResponseStream.CodeEventMember | ChatResponseStream.CodeReferenceEventMember | ChatResponseStream.DryRunSucceedEventMember @@ -3433,7 +3106,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3454,7 +3126,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3475,7 +3146,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3496,7 +3166,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3517,7 +3186,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3538,7 +3206,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3559,7 +3226,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3580,7 +3246,6 @@ export namespace ChatResponseStream { intentsEvent: IntentsEvent; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3601,7 +3266,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent: InteractionComponentsEvent; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown?: never; @@ -3622,28 +3286,6 @@ 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; @@ -3664,7 +3306,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent: InvalidStateEvent; error?: never; $unknown?: never; @@ -3685,7 +3326,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error: InternalServerException; $unknown?: never; @@ -3705,7 +3345,6 @@ export namespace ChatResponseStream { intentsEvent?: never; interactionComponentsEvent?: never; toolUseEvent?: never; - citationEvent?: never; invalidStateEvent?: never; error?: never; $unknown: [string, any]; @@ -3722,7 +3361,6 @@ 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; @@ -3742,7 +3380,6 @@ 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]); @@ -3783,9 +3420,6 @@ 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 }; @@ -4226,8 +3860,6 @@ export interface ExportResultArchiveRequest { * @public */ exportContext?: ExportContext | undefined; - - profileArn?: string | undefined; } /** @@ -4252,6 +3884,61 @@ 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 @@ -4321,8 +4008,6 @@ 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 529fb5b1798..252aa8f3e43 100644 --- a/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts +++ b/src.gen/@amzn/codewhisperer-streaming/src/protocols/Aws_restJson1.ts @@ -26,7 +26,6 @@ import { BinaryPayloadEvent, ChatMessage, ChatResponseStream, - CitationEvent, CodeEvent, CodeReferenceEvent, ConflictException, @@ -44,8 +43,6 @@ import { FollowupPrompt, FollowupPromptEvent, GitState, - ImageBlock, - ImageSource, IntentsEvent, InteractionComponent, InteractionComponentEntry, @@ -75,7 +72,6 @@ import { ToolResult, ToolResultContentBlock, ToolSpecification, - ToolUse, ToolUseEvent, TransformationExportContext, UnitTestGenerationExportContext, @@ -130,7 +126,6 @@ export const se_ExportResultArchiveCommand = async( 'exportContext': _ => _json(_), 'exportId': [], 'exportIntent': [], - 'profileArn': [], })); b.m("POST") .h(headers) @@ -176,7 +171,6 @@ export const se_GenerateTaskAssistPlanCommand = async( let body: any; body = JSON.stringify(take(input, { 'conversationState': _ => se_ConversationState(_, context), - 'profileArn': [], 'workspaceState': _ => _json(_), })); b.m("POST") @@ -563,11 +557,6 @@ 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), @@ -638,15 +627,6 @@ 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 @@ -753,22 +733,7 @@ const de_CommandError = async( // se_AppStudioState 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), - }); - } + // se_AssistantResponseMessage omitted. /** * serializeAws_restJson1ChatHistory @@ -790,7 +755,7 @@ const de_CommandError = async( context: __SerdeContext ): any => { return ChatMessage.visit(input, { - assistantResponseMessage: value => ({ "assistantResponseMessage": se_AssistantResponseMessage(value, context) }), + assistantResponseMessage: value => ({ "assistantResponseMessage": _json(value) }), userInputMessage: value => ({ "userInputMessage": se_UserInputMessage(value, context) }), _: (name, value) => ({ name: value } as any) }); @@ -836,44 +801,6 @@ 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. @@ -1019,32 +946,6 @@ 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. @@ -1058,8 +959,6 @@ const de_CommandError = async( ): any => { return take(input, { 'content': [], - 'images': _ => se_ImageBlocks(_, context), - 'origin': [], 'userInputMessageContext': _ => se_UserInputMessageContext(_, context), 'userIntent': [], }); @@ -1107,10 +1006,6 @@ const de_CommandError = async( }) as any; } - // de_CitationEvent omitted. - - // de_CitationTarget omitted. - // de_CodeEvent omitted. // de_CodeReferenceEvent omitted.