Skip to content

Commit 12bfb37

Browse files
authored
Add api reference for citations and document (#8801)
* Add api reference for citations and document * fix generate api docs
1 parent 0ccdb14 commit 12bfb37

File tree

7 files changed

+57
-2
lines changed

7 files changed

+57
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# dspy.experimental.Citations
2+
3+
<!-- START_API_REF -->
4+
::: dspy.experimental.Citations
5+
handler: python
6+
options:
7+
members:
8+
- description
9+
- extract_custom_type_from_annotation
10+
- format
11+
- from_dict_list
12+
- serialize_model
13+
- validate_input
14+
show_source: true
15+
show_root_heading: true
16+
heading_level: 2
17+
docstring_style: google
18+
show_root_full_path: true
19+
show_object_full_path: false
20+
separate_signature: false
21+
inherited_members: true
22+
:::
23+
<!-- END_API_REF -->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# dspy.experimental.Document
2+
3+
<!-- START_API_REF -->
4+
::: dspy.experimental.Document
5+
handler: python
6+
options:
7+
members:
8+
- description
9+
- extract_custom_type_from_annotation
10+
- format
11+
- serialize_model
12+
- validate_input
13+
show_source: true
14+
show_root_heading: true
15+
heading_level: 2
16+
docstring_style: google
17+
show_root_full_path: true
18+
show_object_full_path: false
19+
separate_signature: false
20+
inherited_members: true
21+
:::
22+
<!-- END_API_REF -->

docs/docs/api/optimizers/GEPA.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
handler: python
88
options:
99
members:
10+
- auto_budget
1011
- compile
12+
- get_params
1113
show_source: true
1214
show_root_heading: true
1315
heading_level: 2

docs/docs/api/primitives/Image.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
- from_file
1313
- from_url
1414
- serialize_model
15-
- validate_input
1615
show_source: true
1716
show_root_heading: true
1817
heading_level: 2

docs/mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ nav:
9898
- SemanticF1: api/evaluation/SemanticF1.md
9999
- answer_exact_match: api/evaluation/answer_exact_match.md
100100
- answer_passage_match: api/evaluation/answer_passage_match.md
101+
- Experimental:
102+
- Citations: api/experimental/Citations.md
103+
- Document: api/experimental/Document.md
101104
- Models:
102105
- Embedder: api/models/Embedder.md
103106
- LM: api/models/LM.md

docs/scripts/generate_api_docs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
dspy.InferRules,
8181
dspy.GEPA
8282
],
83+
"experimental": [
84+
dspy.experimental.Citations,
85+
dspy.experimental.Document,
86+
],
8387
}
8488

8589

@@ -107,7 +111,8 @@ def get_module_contents(module):
107111
contents[name] = obj
108112
elif (
109113
(inspect.isclass(obj) or (inspect.isroutine(obj) and should_document_method(obj)))
110-
and obj.__module__.startswith(module.__name__)
114+
# classes or functions in experimental module are not located in dspy/experimental
115+
and (obj.__module__.startswith(module.__name__) or module.__name__.startswith("dspy.experimental"))
111116
and not name.startswith("_")
112117
):
113118
contents[name] = obj

docs/scripts/generate_api_summary.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"optimizers": "Optimizers",
1111
"utils": "Utils",
1212
"tools": "Tools",
13+
"experimental": "Experimental",
1314
}
1415

1516

0 commit comments

Comments
 (0)