const response = await qualifire.evaluate({ input: "What is the capital of France?", output: "Paris", contentModerationCheck: true, hallucinationsCheck: true,});
from qualifire.types import LLMMessage, LLMToolCall, LLMToolDefinition, ModelModeres = client.evaluate( messages=[ LLMMessage( role="user", content="What is the weather tomorrow in New York?", ), LLMMessage( role="assistant", content="please run the following tool", tool_calls=[ LLMToolCall( id="tool_call_id", name="get_weather_forecast", arguments={ "location": "New York, NY", "date": "tomorrow", }, ), ], ), ], available_tools=[ LLMToolDefinition( name="get_weather_forecast", description="Provides the weather forecast for a given location and date.", parameters={ "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g., San Francisco, CA", }, "date": { "type": "string", "description": "The date for the forecast, e.g., tomorrow, or YYYY-MM-DD", }, }, "required": ["location", "date"], }, ), ], tool_use_quality_check=True, tuq_mode=ModelMode.BALANCED,)
Metadata
Attach custom key-value metadata to any evaluation. Metadata is persisted alongside the invocation and can be used for filtering and grouping in the Qualifire UI.All values must be strings. The API returns a 422 error if any value is not a string.
Copy
const response = await qualifire.evaluate({ input: "What is the capital of France?", output: "Paris", hallucinationsCheck: true, metadata: { environment: "production", userId: "user-123", sessionId: "sess-abc", },});
Metadata also works with invokeEvaluation / invoke_evaluation:
Copy
const response = await qualifire.invokeEvaluation({ input: "What is the capital of France?", output: "Paris", evaluationId: "g2r8puzojwb8q6yi2f6x162a", metadata: { environment: "staging" },});
Policy Target
Control whether checks apply to input, output, or both:
Include tool definitions and tool calls in the policy assertion context. When enabled, assertions can reference available tools and tool call arguments — for example, “must use the search tool before answering”.
Copy
const response = await qualifire.evaluate({ messages: [ { role: "user", content: "Find the weather in NYC" }, { role: "assistant", content: "Let me check.", tool_calls: [{ name: "get_weather", arguments: { location: "NYC" } }] }, ], assertions: ["must use the get_weather tool"], policyIncludeTools: true,});