dspy.TwoStepAdapter

dspy.TwoStepAdapter

이 페이지는 DSPy의 TwoStepAdapter를 다뤄요. 이름 그대로 두 단계로 나눠 처리하는 어댑터로, 시그니처와 데모를 메시지로 만들고(format), 그 형식으로 요청을 보낸 뒤 LM 응답을 파싱(parse)해서 Prediction으로 만들어요. 이 베이스 구조에서 조금 다른 형식화·파싱 규칙이 필요한 경우에 파생해서 쓰는 어댑터예요.

출처: 문서

본문

TwoStepAdapter는 Adapter의 형식화·파싱 기능을 기반으로 동작하며, 채팅 대화 히스토리까지 함께 다룰 수 있어요. 아래는 이 클래스가 노출하는 멤버 목록이에요.

::: dspy.TwoStepAdapter
    handler: python
    options:
        members:
            - __call__
            - acall
            - format
            - format_assistant_message_content
            - format_conversation_history
            - format_demos
            - format_field_description
            - format_field_structure
            - format_system_message
            - format_task_description
            - format_user_message_content
            - parse
        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)