> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # getScorerById() 그만큼`getScorerById()`메소드는 해당 항목을 검색하여 득점자를 검색합니다.`id`재산(또는`name`대체 속성) 등록 키가 아닌 이는 득점자의 ID를 알고 있지만 Mastra 인스턴스에 어떻게 등록되었는지 반드시 알 필요는 없을 때 유용합니다. ## 사용예 ```typescript import { mastra } from './mastra' // Get a scorer by its id property const relevancyScorer = mastra.getScorerById('answer-relevancy-scorer') const weatherAgent = mastra.getAgent('weatherAgent') // Use the scorer to evaluate an AI output await weatherAgent.generate('What is the weather in Rome', { scorers: { answerRelevancy: { scorer: relevancyScorer, }, }, }) ``` ## 매개변수 **id** (`string`): 가져올 스코어러의 id 속성입니다. createScorer()로 스코어러를 생성할 때 지정한 'id' 필드와 일치해야 합니다. 이 메서드는 대체 수단으로 'name' 속성도 검색합니다. ## 보고 **scorer** (`MastraScorer`): 일치하는 id(또는 name) 속성을 가진 MastraScorer 인스턴스입니다. ## 오류 처리 다음과 같은 경우 이 메서드에서 `MastraError`가 발생합니다. - 지정된 ID를 가진 득점자를 찾을 수 없습니다. - Mastra 인스턴스에 등록된 득점자가 없습니다. ```typescript try { const scorer = mastra.getScorerById('non-existent-scorer') } catch (error) { if (error.id === 'MASTRA_GET_SCORER_BY_ID_NOT_FOUND') { console.log('Scorer with that id not found') } } ``` ## 관련된 - [득점자()](https://mastra.zisheng.pro/ko/reference/core/getScorer): 등록키로 득점자를 얻습니다. - [목록득점자()](https://mastra.zisheng.pro/ko/reference/core/listScorers): 등록된 모든 득점자를 가져옵니다. - [생성스코어러()](https://mastra.zisheng.pro/ko/reference/evals/create-scorer): ID를 사용하여 득점자를 만드는 방법을 알아보세요.