DSPy: The framework for programming—not prompting—language models
Python
Update API reference (#8844)
TomuHiratab33fd0b5938f
diff --git a/docs/docs/api/evaluation/EvaluationResult.md b/docs/docs/api/evaluation/EvaluationResult.mdnew file mode 100644index 000000000..f0b4ff714--- /dev/null+++ b/docs/docs/api/evaluation/EvaluationResult.md@@ -0,0 +1,31 @@+# dspy.evaluate.EvaluationResult+++<!-- START_API_REF -->+::: dspy.evaluate.EvaluationResult+ handler: python+ options:+ members:+ - copy+ - from_completions+ - get+ - get_lm_usage+ - inputs+ - items+ - keys+ - labels+ - set_lm_usage+ - toDict+ - values+ - with_inputs+ - without+ 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+:::+<!-- END_API_REF -->diff --git a/docs/docs/api/experimental/Citations.md b/docs/docs/api/experimental/Citations.mdindex 1ed10ccab..663372d29 100644--- a/docs/docs/api/experimental/Citations.md+++ b/docs/docs/api/experimental/Citations.md@@ -9,6 +9,9 @@- extract_custom_type_from_annotation- format- from_dict_list+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_model- validate_inputshow_source: truediff --git a/docs/docs/api/experimental/Document.md b/docs/docs/api/experimental/Document.mdindex 7ef43079b..40c8f9c38 100644--- a/docs/docs/api/experimental/Document.md+++ b/docs/docs/api/experimental/Document.md@@ -8,6 +8,9 @@- description- extract_custom_type_from_annotation- format+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_model- validate_inputshow_source: truediff --git a/docs/docs/api/primitives/Audio.md b/docs/docs/api/primitives/Audio.mdindex 8ad304bdf..21e0cdf3b 100644--- a/docs/docs/api/primitives/Audio.md+++ b/docs/docs/api/primitives/Audio.md@@ -1,6 +1,5 @@# dspy.Audio-<!-- START_API_REF -->::: dspy.Audiohandler: python@@ -12,6 +11,9 @@- from_array- from_file- from_url+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_model- validate_inputshow_source: truediff --git a/docs/docs/api/primitives/Code.md b/docs/docs/api/primitives/Code.mdindex 96a0a212e..5c07c6787 100644--- a/docs/docs/api/primitives/Code.md+++ b/docs/docs/api/primitives/Code.md@@ -1,6 +1,5 @@# dspy.Code-<!-- START_API_REF -->::: dspy.Codehandler: python@@ -9,6 +8,9 @@- description- extract_custom_type_from_annotation- format+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_model- validate_inputshow_source: truediff --git a/docs/docs/api/primitives/Image.md b/docs/docs/api/primitives/Image.mdindex eaef4ba66..abc161c08 100644--- a/docs/docs/api/primitives/Image.md+++ b/docs/docs/api/primitives/Image.md@@ -11,6 +11,9 @@- from_PIL- from_file- from_url+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_modelshow_source: trueshow_root_heading: truediff --git a/docs/docs/api/primitives/Tool.md b/docs/docs/api/primitives/Tool.mdindex 441e8bca7..6e32d40c7 100644--- a/docs/docs/api/primitives/Tool.md+++ b/docs/docs/api/primitives/Tool.md@@ -13,6 +13,9 @@- format_as_litellm_function_call- from_langchain- from_mcp_tool+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_modelshow_source: trueshow_root_heading: truediff --git a/docs/docs/api/primitives/ToolCalls.md b/docs/docs/api/primitives/ToolCalls.mdindex 192095863..492de64ff 100644--- a/docs/docs/api/primitives/ToolCalls.md+++ b/docs/docs/api/primitives/ToolCalls.md@@ -1,6 +1,5 @@# dspy.ToolCalls-<!-- START_API_REF -->::: dspy.ToolCallshandler: python@@ -10,6 +9,9 @@- extract_custom_type_from_annotation- format- from_dict_list+ - is_streamable+ - parse_lm_response+ - parse_stream_chunk- serialize_model- validate_inputshow_source: truediff --git a/docs/mkdocs.yml b/docs/mkdocs.ymlindex cfae69f91..f45736b6a 100644--- a/docs/mkdocs.yml+++ b/docs/mkdocs.yml@@ -95,6 +95,7 @@ nav:- Evaluation:- CompleteAndGrounded: api/evaluation/CompleteAndGrounded.md- Evaluate: api/evaluation/Evaluate.md+ - EvaluationResult: api/evaluation/EvaluationResult.md- SemanticF1: api/evaluation/SemanticF1.md- answer_exact_match: api/evaluation/answer_exact_match.md- answer_passage_match: api/evaluation/answer_passage_match.mddiff --git a/docs/scripts/generate_api_docs.py b/docs/scripts/generate_api_docs.pyindex e06293c77..6d5a14e4b 100644--- a/docs/scripts/generate_api_docs.py+++ b/docs/scripts/generate_api_docs.py@@ -68,6 +68,7 @@ API_MAPPING = {dspy.evaluate.answer_passage_match,dspy.evaluate.SemanticF1,dspy.evaluate.CompleteAndGrounded,+ dspy.evaluate.EvaluationResult,],"optimizers": [dspy.LabeledFewShot,