DSPy: The framework for programming—not prompting—language models
Python
Add api reference for citations and document (#8801)
TomuHirata12bfb375bb9a
diff --git a/docs/docs/api/experimental/Citations.md b/docs/docs/api/experimental/Citations.mdnew file mode 100644index 000000000..1ed10ccab--- /dev/null+++ b/docs/docs/api/experimental/Citations.md@@ -0,0 +1,23 @@+# dspy.experimental.Citations++<!-- START_API_REF -->+::: dspy.experimental.Citations+ handler: python+ options:+ members:+ - description+ - extract_custom_type_from_annotation+ - format+ - from_dict_list+ - serialize_model+ - validate_input+ 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/Document.md b/docs/docs/api/experimental/Document.mdnew file mode 100644index 000000000..7ef43079b--- /dev/null+++ b/docs/docs/api/experimental/Document.md@@ -0,0 +1,22 @@+# dspy.experimental.Document++<!-- START_API_REF -->+::: dspy.experimental.Document+ handler: python+ options:+ members:+ - description+ - extract_custom_type_from_annotation+ - format+ - serialize_model+ - validate_input+ 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/optimizers/GEPA.md b/docs/docs/api/optimizers/GEPA.mdindex 707d974b0..9b7484fc5 100644--- a/docs/docs/api/optimizers/GEPA.md+++ b/docs/docs/api/optimizers/GEPA.md@@ -7,7 +7,9 @@handler: pythonoptions:members:+ - auto_budget- compile+ - get_paramsshow_source: trueshow_root_heading: trueheading_level: 2diff --git a/docs/docs/api/primitives/Image.md b/docs/docs/api/primitives/Image.mdindex c90298421..eaef4ba66 100644--- a/docs/docs/api/primitives/Image.md+++ b/docs/docs/api/primitives/Image.md@@ -12,7 +12,6 @@- from_file- from_url- serialize_model- - validate_inputshow_source: trueshow_root_heading: trueheading_level: 2diff --git a/docs/mkdocs.yml b/docs/mkdocs.ymlindex bbab99710..b39b1e0c7 100644--- a/docs/mkdocs.yml+++ b/docs/mkdocs.yml@@ -98,6 +98,9 @@ nav:- SemanticF1: api/evaluation/SemanticF1.md- answer_exact_match: api/evaluation/answer_exact_match.md- answer_passage_match: api/evaluation/answer_passage_match.md+ - Experimental:+ - Citations: api/experimental/Citations.md+ - Document: api/experimental/Document.md- Models:- Embedder: api/models/Embedder.md- LM: api/models/LM.mddiff --git a/docs/scripts/generate_api_docs.py b/docs/scripts/generate_api_docs.pyindex c7fb81106..11d391b29 100644--- a/docs/scripts/generate_api_docs.py+++ b/docs/scripts/generate_api_docs.py@@ -80,6 +80,10 @@ API_MAPPING = {dspy.InferRules,dspy.GEPA],+ "experimental": [+ dspy.experimental.Citations,+ dspy.experimental.Document,+ ],}@@ -107,7 +111,8 @@ def get_module_contents(module):contents[name] = objelif ((inspect.isclass(obj) or (inspect.isroutine(obj) and should_document_method(obj)))- and obj.__module__.startswith(module.__name__)+ # classes or functions in experimental module are not located in dspy/experimental+ and (obj.__module__.startswith(module.__name__) or module.__name__.startswith("dspy.experimental"))and not name.startswith("_")):contents[name] = objdiff --git a/docs/scripts/generate_api_summary.py b/docs/scripts/generate_api_summary.pyindex c918e734b..aa69bfe5a 100644--- a/docs/scripts/generate_api_summary.py+++ b/docs/scripts/generate_api_summary.py@@ -10,6 +10,7 @@ INDEX_NAME = {"optimizers": "Optimizers","utils": "Utils","tools": "Tools",+ "experimental": "Experimental",}