Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ type Recipe {
}

type Query {
summarize(input: String): String @generation(aiModel: "anthropic.claude-3-haiku-20240307-v1:0", systemPrompt: "summarize the input.")
summarize(input: String): String
@generation(
aiModel: "anthropic.claude-3-haiku-20240307-v1:0"
systemPrompt: "summarize the input."
inferenceConfiguration: { temperature: 0.5 }
)

generateRecipe(description: String): Recipe
@generation(aiModel: "anthropic.claude-3-haiku-20240307-v1:0", systemPrompt: "You are a 3 star michelin chef that generates recipes.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export function request(ctx) {
const toolConfig = {"tools":[{"toolSpec":{"name":"responseType","description":"Generate a response type for the given field.","inputSchema":{"json":{"type":"object","properties":{"value":{"type":"string","description":"A UTF-8 character sequence."}},"required":["value"]}}}}],"toolChoice":{"tool":{"name":"responseType"}}};
const prompt = "Generate a string based on the description.";
const args = JSON.stringify(ctx.args);
const inferenceConfig = { inferenceConfig: {"maxTokens":100,"temperature":0.7,"topP":0.9} },;
const inferenceConfig = { inferenceConfig: {"maxTokens":100,"temperature":0.7,"topP":0.9} };

return {
resourcePath: '/model/anthropic.claude-3-haiku-20240307-v1:0/converse',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const generateResolver = (fileName: string, values: Record<string, string>): str
*/
const getInferenceConfigResolverDefinition = (inferenceConfiguration?: InferenceConfiguration): string => {
return inferenceConfiguration && Object.keys(inferenceConfiguration).length > 0
? `{ inferenceConfig: ${JSON.stringify(inferenceConfiguration)} },`
? `{ inferenceConfig: ${JSON.stringify(inferenceConfiguration)} }`
: 'undefined';
};

Expand Down
Loading