> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 빠른 점검 Quick Checks는 일반적인 어설션을 위한 LLM이 없는 구성 가능한 마이크로 점수 측정기입니다. 그들은 기존에 연결`scorers: [...]`득점자가 사용되는 모든 곳의 배열:`runEvals`, 라이브 채점, 실험 및 Studio. 내부적으로는 표준 `createScorer()` 인스턴스이므로 다른 채점기와 동일한 Observability, 스토리지 및 파이프라인 통합 기능을 제공합니다. ## 사용예 ```typescript import { checks } from '@mastra/evals/checks' import { runEvals } from '@mastra/core/evals' import { myAgent } from '../agents' const result = await runEvals({ data: [{ input: 'What is the weather in Brooklyn?' }], target: myAgent, scorers: [ checks.includes('sunny'), checks.calledTool('get_weather'), checks.toolOrder(['get_weather', 'summarize']), checks.noToolErrors(), ], }) console.log(result.scores) ``` ## 텍스트 확인 ### `checks.includes(expected, options?)` Agent의 출력 텍스트에 예상된 하위 문자열이 포함되어 있으면 1점을 받고, 그렇지 않으면 0점을 얻습니다. ```typescript checks.includes('sunny') checks.includes('Sunny', { ignoreCase: false }) ``` **expected** (`string`): 출력에서 검색할 부분 문자열입니다. **options.ignoreCase** (`boolean`): 대소문자를 구분하지 않는 일치입니다. (Default: `true`) 반환값: 발견되면 `1`, 그렇지 않으면 `0`입니다. ### `checks.excludes(unwanted, options?)` Agent의 출력 텍스트에 하위 문자열이 포함되어 있지 않으면 1점을 받고, 그렇지 않으면 0점을 얻습니다. ```typescript checks.excludes('error') checks.excludes('Error', { ignoreCase: false }) ``` **unwanted** (`string`): 출력에 나타나서는 안 되는 부분 문자열입니다. **options.ignoreCase** (`boolean`): 대소문자를 구분하지 않는 일치입니다. (Default: `true`) 반환값: 없으면 `1`, 그렇지 않으면 `0`입니다. ### `checks.equals(expected, options?)` 선택적 정규화 후 출력 텍스트가 예상 문자열과 정확히 일치하면 1점을 얻습니다. ```typescript checks.equals('Hello, world!') checks.equals('Hello', { ignoreCase: false }) ``` **expected** (`string`): 출력과 정확히 일치해야 하는 문자열입니다. **options.ignoreCase** (`boolean`): 대소문자를 구분하지 않는 일치입니다. (Default: `true`) 반환값: 같으면 `1`, 그렇지 않으면 `0`입니다. ### `checks.matches(pattern, options?)` 출력이 정규식과 일치하면 1점을 얻습니다. ```typescript checks.matches(/\d+°[FC]/) checks.matches(/^hello$/, { exact: true }) ``` **pattern** (`RegExp`): 출력에 대해 테스트할 정규 표현식입니다. **options.exact** (`boolean`): 전체 출력과 일치하도록 패턴을 앵커링합니다(^ 및 $ 추가). (Default: `false`) 반환값: 일치하면 `1`, 그렇지 않으면 `0`입니다. ### `checks.similarity(expected, options?)` Dice 계수를 사용하여 출력과 예상 문자열 사이의 문자열 유사성 점수(0\~1)를 반환합니다. `threshold`가 설정되면 대신 이진 값 1/0을 반환합니다. ```typescript checks.similarity('Sunny, 72°F') checks.similarity('Sunny, 72°F', { threshold: 0.7 }) ``` **expected** (`string`): 비교할 기준 문자열입니다. **options.threshold** (`number`): 1을 반환하기 위한 최소 유사성 점수입니다(0\~1). 생략하면 원시 유사성 점수를 반환합니다. **options.ignoreCase** (`boolean`): 대소문자를 구분하지 않는 비교입니다. (Default: `true`) 반환값: 원시 유사성 점수(0\~1) 또는 `threshold`가 설정된 경우 이진 값 `1`/`0`입니다. ## Tool 호출 확인 ### `checks.calledTool(toolName, options?)` Agent가 지정된 Tool을 필요한 횟수 이상 호출하면 1점을 얻습니다. ```typescript checks.calledTool('get_weather') checks.calledTool('search', { times: 2 }) ``` **toolName** (`string`): 찾을 Tool의 이름입니다. **options.times** (`number`): Tool이 호출되어야 하는 최소 횟수입니다. (Default: `1`) 반환값: `times`회 이상 호출되면 `1`, 그렇지 않으면 `0`입니다. ### `checks.didNotCall(toolName)` Agent가 지정된 Tool을 호출하지 않은 경우 1점을 얻습니다. ```typescript checks.didNotCall('delete_user') ``` **toolName** (`string`): 나타나서는 안 되는 Tool의 이름입니다. 반환값: Tool이 호출되지 않았으면 `1`, 그렇지 않으면 `0`입니다. ### `checks.toolOrder(expectedOrder)` Tool이 지정된 순서로 호출되면 1점을 얻습니다. 편안한 매칭을 사용합니다. 예상되는 Tool 간의 다른 Tool 호출이 허용됩니다. ```typescript checks.toolOrder(['search', 'summarize', 'respond']) ``` **expectedOrder** (`string[]`): 예상 호출 순서의 Tool 이름입니다. 실제 Tool 호출의 부분 수열로 나타나야 합니다. 반환값: 예상 순서를 충족하면 `1`, 그렇지 않으면 `0`입니다. ### `checks.maxToolCalls(max)` Agent가 다음 이상을 사용하지 않은 경우 1점을 얻습니다.`max` tool calls. ```typescript checks.maxToolCalls(5) ``` **max** (`number`): 허용되는 최대 Tool 호출 횟수입니다. 반환값: 제한 이내이면 `1`, 그렇지 않으면 `0`입니다. ### `checks.usedNoTools()` Agent가 Tool 호출을 전혀 하지 않은 경우 1점을 얻습니다. ```typescript checks.usedNoTools() ``` 반환값: 호출된 Tool이 없으면 `1`, 그렇지 않으면 `0`입니다. ### `checks.noToolErrors()` 어떤 Tool 호출에서도 오류 상태가 발생하지 않으면 1점을 얻습니다. 오류 결과(`result.error`가 있음)와 완료되지 않은 Tool 호출(`state === 'call'`)을 모두 감지합니다. ```typescript checks.noToolErrors() ``` 반환값: 모든 Tool 호출이 성공하면 `1`, 그렇지 않으면 `0`입니다. ## 다른 채점자와 수표 결합 동일한 LLM 기반 및 코드 기반 채점자를 사용하여 구성을 확인합니다.`scorers` array: ```typescript import { checks } from '@mastra/evals/checks' import { createAnswerRelevancyScorer } from '@mastra/evals/scorers/prebuilt' import { runEvals } from '@mastra/core/evals' import { myAgent } from '../agents' const result = await runEvals({ data: [{ input: 'What is the weather in Brooklyn?' }], target: myAgent, scorers: [ // Zero-LLM checks checks.includes('Brooklyn'), checks.calledTool('get_weather'), checks.noToolErrors(), // LLM-based scorer createAnswerRelevancyScorer({ model: 'openai/gpt-5-mini' }), ], }) ``` ## 관련된 - [빠른 검사 개요](https://mastra.zisheng.pro/ko/docs/evals/quick-checks) - [내장 득점자](https://mastra.zisheng.pro/ko/docs/evals/built-in-scorers) - [`createScorer()`참조](https://mastra.zisheng.pro/ko/reference/evals/create-scorer) - [`runEvals()`참조](https://mastra.zisheng.pro/ko/reference/evals/run-evals) - [맞춤 채점자](https://mastra.zisheng.pro/ko/docs/evals/custom-scorers)