Skip to content

Commit

Permalink
tests: update test snapshot and fix call order
Browse files Browse the repository at this point in the history
  • Loading branch information
massi-ang committed Aug 6, 2024
1 parent 871dcc1 commit d36f8d9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,13 @@ input CreateWorkspaceKendraInput {
useAllData: Boolean!
}
input CreateWorkspaceBedrockKBInput {
name: String!
kind: String!
knowledgeBaseId: String!
hybridSearch: Boolean!
}
input CreateWorkspaceOpenSearchInput {
name: String!
kind: String!
Expand Down Expand Up @@ -1580,6 +1587,12 @@ type KendraIndex @aws_cognito_user_pools {
external: Boolean!
}
type BedrockKB @aws_cognito_user_pools {
id: String!
name: String!
external: Boolean!
}
input ListDocumentsInput {
workspaceId: String!
documentType: String!
Expand Down Expand Up @@ -1732,6 +1745,8 @@ type Workspace @aws_cognito_user_pools {
kendraIndexId: String
kendraIndexExternal: Boolean
kendraUseAllData: Boolean
knowledgeBaseId: String
knowledgeBaseExternal: Boolean
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
}
Expand All @@ -1745,6 +1760,8 @@ type Channel @aws_iam @aws_cognito_user_pools {
type Mutation {
createKendraWorkspace(input: CreateWorkspaceKendraInput!): Workspace!
@aws_cognito_user_pools
createBedrockKBWorkspace(input: CreateWorkspaceBedrockKBInput!): Workspace!
@aws_cognito_user_pools
createOpenSearchWorkspace(input: CreateWorkspaceOpenSearchInput!): Workspace!
@aws_cognito_user_pools
createAuroraWorkspace(input: CreateWorkspaceAuroraInput!): Workspace!
Expand Down Expand Up @@ -1788,6 +1805,7 @@ type Query {
@aws_cognito_user_pools
getSession(id: String!): Session @aws_cognito_user_pools
listKendraIndexes: [KendraIndex!]! @aws_cognito_user_pools
listBedrockKnowledgeBases: [BedrockKB!]! @aws_cognito_user_pools
isKendraDataSynching(workspaceId: String!): Boolean @aws_cognito_user_pools
listDocuments(input: ListDocumentsInput!): DocumentsResult!
@aws_cognito_user_pools
Expand Down Expand Up @@ -1965,6 +1983,25 @@ schema {
},
"Type": "AWS::AppSync::Resolver",
},
"ChatBotApiConstructChatbotApicreateBedrockKBWorkspaceresolverC35C5AB8": {
"DependsOn": [
"ChatBotApiConstructChatbotApiproxyResolverFunction22AA16EE",
"ChatBotApiConstructChatbotApiSchema07900657",
],
"Properties": {
"ApiId": {
"Fn::GetAtt": [
"ChatBotApiConstructChatbotApi21E23C68",
"ApiId",
],
},
"DataSourceName": "proxyResolverFunction",
"FieldName": "createBedrockKBWorkspace",
"Kind": "UNIT",
"TypeName": "Mutation",
},
"Type": "AWS::AppSync::Resolver",
},
"ChatBotApiConstructChatbotApicreateKendraWorkspaceresolver03A533E2": {
"DependsOn": [
"ChatBotApiConstructChatbotApiproxyResolverFunction22AA16EE",
Expand Down Expand Up @@ -2193,6 +2230,25 @@ schema {
},
"Type": "AWS::AppSync::Resolver",
},
"ChatBotApiConstructChatbotApilistBedrockKnowledgeBasesresolver6F8C3883": {
"DependsOn": [
"ChatBotApiConstructChatbotApiproxyResolverFunction22AA16EE",
"ChatBotApiConstructChatbotApiSchema07900657",
],
"Properties": {
"ApiId": {
"Fn::GetAtt": [
"ChatBotApiConstructChatbotApi21E23C68",
"ApiId",
],
},
"DataSourceName": "proxyResolverFunction",
"FieldName": "listBedrockKnowledgeBases",
"Kind": "UNIT",
"TypeName": "Query",
},
"Type": "AWS::AppSync::Resolver",
},
"ChatBotApiConstructChatbotApilistCrossEncodersresolver4989A3B4": {
"DependsOn": [
"ChatBotApiConstructChatbotApiproxyResolverFunction22AA16EE",
Expand Down Expand Up @@ -14135,7 +14191,7 @@ schema {
"SharedConfig358B4A20": {
"Properties": {
"Type": "String",
"Value": "{"prefix":"prefix","privateWebsite":true,"certificate":"","cfGeoRestrictEnable":true,"cfGeoRestrictList":[],"bedrock":{"enabled":true,"region":"us-east-1"},"llms":{"sagemaker":["FalconLite [ml.g5.12xlarge]"]},"rag":{"enabled":true,"engines":{"aurora":{"enabled":true},"opensearch":{"enabled":true},"kendra":{"enabled":true,"createIndex":true,"enterprise":true}},"embeddingsModels":[{"provider":"sagemaker","name":"intfloat/multilingual-e5-large","dimensions":1024},{"provider":"sagemaker","name":"sentence-transformers/all-MiniLM-L6-v2","dimensions":384},{"provider":"bedrock","name":"amazon.titan-embed-text-v1","dimensions":1536},{"provider":"bedrock","name":"amazon.titan-embed-image-v1","dimensions":1024},{"provider":"bedrock","name":"cohere.embed-english-v3","dimensions":1024},{"provider":"bedrock","name":"cohere.embed-multilingual-v3","dimensions":1024,"default":true},{"provider":"openai","name":"text-embedding-ada-002","dimensions":1536}],"crossEncoderModels":[{"provider":"sagemaker","name":"cross-encoder/ms-marco-MiniLM-L-12-v2","default":true}]}}",
"Value": "{"prefix":"prefix","privateWebsite":true,"certificate":"","cfGeoRestrictEnable":true,"cfGeoRestrictList":[],"bedrock":{"enabled":true,"region":"us-east-1"},"llms":{"sagemaker":["FalconLite [ml.g5.12xlarge]"]},"rag":{"enabled":true,"engines":{"aurora":{"enabled":true},"opensearch":{"enabled":true},"kendra":{"enabled":true,"createIndex":true,"enterprise":true},"knowledgeBase":{"enabled":false}},"embeddingsModels":[{"provider":"sagemaker","name":"intfloat/multilingual-e5-large","dimensions":1024},{"provider":"sagemaker","name":"sentence-transformers/all-MiniLM-L6-v2","dimensions":384},{"provider":"bedrock","name":"amazon.titan-embed-text-v1","dimensions":1536},{"provider":"bedrock","name":"amazon.titan-embed-image-v1","dimensions":1024},{"provider":"bedrock","name":"cohere.embed-english-v3","dimensions":1024},{"provider":"bedrock","name":"cohere.embed-multilingual-v3","dimensions":1024,"default":true},{"provider":"openai","name":"text-embedding-ada-002","dimensions":1536}],"crossEncoderModels":[{"provider":"sagemaker","name":"cross-encoder/ms-marco-MiniLM-L-12-v2","default":true}]}}",
},
"Type": "AWS::SSM::Parameter",
},
Expand Down
8 changes: 4 additions & 4 deletions tests/chatbot-api/functions/outgoing-message-appsync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ const validEvent: SQSEvent = {
{
body: JSON.stringify({
Message: JSON.stringify({
userId: "userId9999",
data: { sessionId: "sessionId9999", token: { sequenceNumber: 9999 } },
userId: "userId1",
data: { sessionId: "sessionId1", token: { sequenceNumber: 1 } },
}),
}),
} as SQSRecord,
{
body: JSON.stringify({
Message: JSON.stringify({
userId: "userId1",
data: { sessionId: "sessionId1", token: { sequenceNumber: 1 } },
userId: "userId9999",
data: { sessionId: "sessionId9999", token: { sequenceNumber: 9999 } },
}),
}),
} as SQSRecord,
Expand Down
8 changes: 1 addition & 7 deletions tests/utils/config-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ export function getTestConfig(): SystemConfig {
enterprise: true,
},
knowledgeBase: {
enabled: true,
external: [
{
name: "test",
knowledgeBaseId: "ABCDEIWED",
},
],
enabled: false,
},
},
embeddingsModels: [
Expand Down

0 comments on commit d36f8d9

Please sign in to comment.