You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried following a few how tos but they always lead to errors. Is there a way to pass in my own data into the conversation? Below is some code I found here: aws-amplify/amplify-ui#5773
import { type ClientSchema, a, defineData, defineFunction } from "@aws-amplify/backend";
export const getWeather = defineFunction({
name: 'getWeather',
entry: './getWeather.ts',
});
const schema = a.schema({
chat: a.conversation({
aiModel: a.ai.model("Claude 3 Haiku"),
systemPrompt: `You are a helpful assistant`,
tools: [
{
query: a.ref('getWeather'),
description: 'Get current weather information',
},
],
}),
chatNamer: a
.generation({
aiModel: a.ai.model("Claude 3 Haiku"),
systemPrompt: `You are a helpful assistant that writes descriptive names for conversations. Names should be 2-10 words long`,
})
.arguments({
content: a.string(),
})
.returns(
a.customType({
name: a.string(),
})
)
.authorization((allow) => [allow.authenticated()]),
});
export type Schema = ClientSchema<typeof schema>;
export const data = defineData({
schema,
authorizationModes: {
defaultAuthorizationMode: "userPool",
},
});
Error:
Failed to instantiate data construct
Caused By: Tool "getWeather" defined in @conversation directive has no matching Query field definition
Resolution: See the underlying error message for more details.
I really wanted to pass in data from a query. Maybe even a custom SQL query from my PG database. However, I cannot seem to find an API reference that tells me what I can pass into the conversation. At the end of the day all I really want to do is pass in some data so I can ask the chatbot questions about said data. Any help would be awesome.
The text was updated successfully, but these errors were encountered:
There were some updates a few days ago prior to the GA launch that likely led to the issue you're seeing. So first things first, make sure you pull the current main branch of this repo as a starting point.
I really wanted to pass in data from a query. Maybe even a custom SQL query from my PG database. However, I cannot seem to find an API reference that tells me what I can pass into the conversation. At the end of the day all I really want to do is pass in some data so I can ask the chatbot questions about said data. Any help would be awesome.
What you're describing here is tool use. Check out our documentation on Tools and let me know if you have any questions. Thanks!
I've tried following a few how tos but they always lead to errors. Is there a way to pass in my own data into the conversation? Below is some code I found here: aws-amplify/amplify-ui#5773
Error:
I really wanted to pass in data from a query. Maybe even a custom SQL query from my PG database. However, I cannot seem to find an API reference that tells me what I can pass into the conversation. At the end of the day all I really want to do is pass in some data so I can ask the chatbot questions about said data. Any help would be awesome.
The text was updated successfully, but these errors were encountered: