Whatever message this page gives is out now! Go check it out!
messages array; your handler decides how to respond and which model to use.
{
"messages": [
{
"role": "user",
"content": {
"type": "text",
"text": "What is the weather in New York?"
}
}
]
}
return {
"modelname": "gpt-4o",
"result": "The weather in New York is sunny, 75°F"
};
<cfscript>
function mySamplingHandler(request) {
var messages = request.messages;
var userMessage = messages[1].content.text;
var llmResponse = callMyLLM(userMessage);
return {
modelname: "gpt-4o",
result: llmResponse
};
}
</cfscript>
<cfscript>
configData = {
transport: { /* transport config */ },
capabilities: {
sampling: true
},
samplingConsumer: mySamplingHandler
};
mcpClient = MCPClient(configData);
</cfscript>