@aws-amplify/data-schema
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -11,3 +11,3 @@ 'use strict'; | ||
const getCustomUserAgentDetails_1 = require("./getCustomUserAgentDetails"); | ||
const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async ({ aiContext, content, toolConfiguration }) => { | ||
const createSendMessageFunction = (client, modelIntrospection, conversationId, conversationRouteName, getInternals) => async (input) => { | ||
const { conversations } = modelIntrospection; | ||
@@ -18,2 +18,4 @@ // Safe guard for standalone function. When called as part of client generation, this should never be falsy. | ||
} | ||
const processedInput = typeof input === 'string' ? { content: [{ text: input }] } : input; | ||
const { content, aiContext, toolConfiguration } = processedInput; | ||
const sendSchema = conversations[conversationRouteName].message.send; | ||
@@ -20,0 +22,0 @@ const sendOperation = (0, custom_1.customOpFactory)(client, modelIntrospection, 'mutation', sendSchema, false, getInternals, (0, getCustomUserAgentDetails_1.getCustomUserAgentDetails)(getCustomUserAgentDetails_1.AiAction.SendMessage)); |
@@ -53,3 +53,3 @@ import type { Subscription } from 'rxjs'; | ||
} | ||
interface ConversationSendMessageInput { | ||
export interface ConversationSendMessageInput { | ||
content: ConversationSendMessageInputContent[]; | ||
@@ -71,3 +71,3 @@ aiContext?: string | Record<string, any>; | ||
*/ | ||
sendMessage: (input: ConversationSendMessageInput) => SingularReturnValue<ConversationMessage>; | ||
sendMessage: (input: ConversationSendMessageInput | string) => SingularReturnValue<ConversationMessage>; | ||
/** | ||
@@ -74,0 +74,0 @@ * @experimental |
{ | ||
"name": "@aws-amplify/data-schema", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -59,3 +59,5 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
*/ | ||
delete: (input: ConversationRouteDeleteInput) => SingularReturnValue<Conversation>; | ||
delete: ( | ||
input: ConversationRouteDeleteInput, | ||
) => SingularReturnValue<Conversation>; | ||
/** | ||
@@ -70,3 +72,3 @@ * @experimental | ||
// conversation types | ||
interface ConversationSendMessageInput { | ||
export interface ConversationSendMessageInput { | ||
content: ConversationSendMessageInputContent[]; | ||
@@ -92,3 +94,3 @@ aiContext?: string | Record<string, any>; | ||
sendMessage: ( | ||
input: ConversationSendMessageInput, | ||
input: ConversationSendMessageInput | string, | ||
) => SingularReturnValue<ConversationMessage>; | ||
@@ -95,0 +97,0 @@ /** |
@@ -8,2 +8,3 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
ConversationMessage, | ||
ConversationSendMessageInput, | ||
} from '../../../ai/ConversationType'; | ||
@@ -35,3 +36,3 @@ import { | ||
): Conversation['sendMessage'] => | ||
async ({ aiContext, content, toolConfiguration }) => { | ||
async (input: ConversationSendMessageInput | string) => { | ||
const { conversations } = modelIntrospection; | ||
@@ -43,2 +44,8 @@ | ||
} | ||
const processedInput: ConversationSendMessageInput = | ||
typeof input === 'string' ? { content: [{ text: input }] } : input; | ||
const { content, aiContext, toolConfiguration } = processedInput; | ||
const sendSchema = conversations[conversationRouteName].message.send; | ||
@@ -45,0 +52,0 @@ const sendOperation = customOpFactory( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2206805
30054