dspy.OutputField
dspy.OutputField
시그니처에서 출력(결과) 필드를 선언할 때 쓰는 클래스예요. dspy.Signature 안에서 answer: str = dspy.OutputField(...)처럼 적어두면, 모델이 만들어 내야 할 출력의 이름·타입·설명을 구체적으로 정해줄 수 있어요.
출처: 문서
본문
dspy.OutputField는 시그니처의 출력 필드를 나타내는 타입이에요. 각 출력 필드는 타입(type)과 함께 desc 같은 설명, 그리고 상황에 따라 기본값이나 검증 규칙도 가질 수 있어요. 아래 레퍼런스 블록은 실제 소스 코드의 docstring에서 자동으로 렌더링돼요.
::: dspy.OutputField
handler: python
options:
show_source: true
show_root_heading: true
heading_level: 2
docstring_style: google
show_root_full_path: true
show_object_full_path: false
separate_signature: false
inherited_members: true
더 알아보기 (Learn more)
- dspy.InputField — 입력 필드를 정의할 때 쓰는 클래스
- dspy.Signature — 시그니처 전체를 다루는 클래스
- Signatures in depth — 시그니처 심화