[WIP] Refactor everything server to be more modular and use recommended APIs.
* In sampling-request.ts - renamed SampleLLMSchema to SamplingRequestSchema
This commit is contained in:
parent
df844b5298
commit
08b6a501ce
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ import {
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
// Tool input schema
|
// Tool input schema
|
||||||
const SampleLLMSchema = z.object({
|
const SamplingRequestSchema = z.object({
|
||||||
prompt: z.string().describe("The prompt to send to the LLM"),
|
prompt: z.string().describe("The prompt to send to the LLM"),
|
||||||
maxTokens: z
|
maxTokens: z
|
||||||
.number()
|
.number()
|
||||||
|
|
@ -20,7 +20,7 @@ const name = "sampling-request";
|
||||||
const config = {
|
const config = {
|
||||||
title: "Sampling Request Tool",
|
title: "Sampling Request Tool",
|
||||||
description: "Sends the Client a Request for LLM Sampling",
|
description: "Sends the Client a Request for LLM Sampling",
|
||||||
inputSchema: SampleLLMSchema,
|
inputSchema: SamplingRequestSchema,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,7 +44,7 @@ export const registerSamplingRequestTool = (server: McpServer) => {
|
||||||
name,
|
name,
|
||||||
config,
|
config,
|
||||||
async (args, extra): Promise<CallToolResult> => {
|
async (args, extra): Promise<CallToolResult> => {
|
||||||
const validatedArgs = SampleLLMSchema.parse(args);
|
const validatedArgs = SamplingRequestSchema.parse(args);
|
||||||
const { prompt, maxTokens } = validatedArgs;
|
const { prompt, maxTokens } = validatedArgs;
|
||||||
|
|
||||||
// Create the sampling request
|
// Create the sampling request
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue