-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential mapping template missmatch for converse and invokeModel in @aws-appsync/utils/ai #380
Comments
Hey, thanks for reaching out. I've been unable to reproduce this issue so far. Could you please provide the raw JavaScript resolver code sent to the service? Is this a unit resolver or a function in a pipeline resolver? Thanks! |
Hi, @gilbertw1, Certainly, I can. Here's the generated JavaScript code I use for this unit resolver. // src/stacks/graphql/constructs/endpoint/resolvers/explorer-complete-search-query.resolver.ts
import { converse } from "@aws-appsync/utils/ai";
var request = (ctx) => converse({
modelId: "us.anthropic.claude-3-5-haiku-20241022-v1:0",
system: [
{
text: `
You are a life science assistant who completes scientific search queries based on the text already entered by the researcher.
Return one possible search query completion relevant to the text entered by the researcher.
`
}
],
messages: [
{
role: "user",
content: [{ text: `<query>${ctx.arguments.query}</query>` }]
}
]
});
var response = (ctx) => ctx.result.output.message.content[0].text;
export {
request,
response
};
//# sourceMappingURL=data:application/json;base64,… By the way, I'd be interested in knowing if there are better ways to complete search queries than simply asking Haiku. |
Hey, sorry for the delayed response here. Are you still experiencing this issue? I've tested using the JavaScript code you included in your most recent comment verbatim and was unable to produce the same error you reported. If you are still seeing this error, could you provide some additional information, such as the region you're running in and the resolver runtime configuration? |
I just tried the brand new @aws-appsync/utils/ai converse and invokeModel helpers to write a quick Bedrock invocation resolver. Here's a prototype code:
This results in the following error:
Here's the object generated by converse:
So, if I manually replace "version": null with "version": "2023-07-27", the system will start complaining about other things, such as not knowing what a "toolConfig" is or "system".
The same behaviour was exhibited by invokeModel, tooK
There might be a mismatch between what AppSync/Bedrock expect and the return of converse and invokeModel.
What do you think?
The text was updated successfully, but these errors were encountered: