dspy.ToolCalls
dspy.ToolCalls
dspy.ToolCalls는 도구 호출(tool calls) 목록을 담는 DSPy 타입입니다.
출처: 문서
본문
dspy.ToolCalls
- Bases:
Type
Methods
from_dict_list(tool_calls_dicts) -> ToolCalls (classmethod)
딕셔너리 리스트를 ToolCalls 인스턴스로 변환합니다. 각 딕셔너리는 'name'과 'args' 키를 가져야 합니다.
tool_calls_dict = [
{"name": "search", "args": {"query": "hello"}},
{"name": "translate", "args": {"text": "world"}}
]
tool_calls = ToolCalls.from_dict_list(tool_calls_dict)
format() -> dict[str, Any]
{"tool_calls": [tool_call.format() for tool_call in self.tool_calls]} 형식으로 포맷합니다.
description() -> str (classmethod)
설명입니다. "Tool calls must be a JSON object with tool_calls, a list of calls. Each call must include name and args. Example: {"tool_calls": [{"name": "search", "args": {"query": "cats"}}]}"
표준 상속 메서드
adapt_to_native_lm_feature(...), extract_custom_type_from_annotation(annotation), serialize_model(), parse_lm_response(...), parse_stream_chunk(...), is_streamable(), validate_input(data) 등은 모든 커스텀 타입이 공유하는 base_type.py의 표준 메서드입니다.