File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 11.tag {
2- padding : 2px 5 px ;
3- border-radius : 4 px ;
2+ padding : 2px 3 px ;
3+ border-radius : 3 px ;
44 font-size : 0.8em ;
55 margin-right : 5px ;
66 color : # 000 ;
99code .beta {
1010 display : inline-block;
1111 background-color : # 6c757d ;
12- color : # 999 ;
12+ color : # fff ;
1313}
1414
1515code .prototype {
@@ -23,3 +23,9 @@ code.deprecated {
2323 background-color : red;
2424 color : # fff ;
2525}
26+
27+ code .stable {
28+ display : inline-block;
29+ background-color : # 28a745 ;
30+ color : # fff ;
31+ }
Original file line number Diff line number Diff line change @@ -312,10 +312,10 @@ def generate_llmapi():
312312 content = underline ("API Reference" , "-" ) + "\n \n "
313313 content += ".. note::\n "
314314 content += " Since version 1.0, we have attached a status label to `LLM`, `LlmArgs` and `TorchLlmArgs` Classes.\n \n "
315- content += ' 1. :tag:`prototype ` - The item is a prototype and is subject to change .\n '
316- content += ' 2. :tag:`beta ` - The item is in beta and approaching stability .\n '
317- content += ' 3. :tag:`deprecated ` - The item is deprecated and will be removed in a future release .\n '
318- content += " 4. For the remaining items without a status label, they are considered **stable** .\n "
315+ content += " 1. :tag:`stable ` - The item is stable and will keep consistent .\n "
316+ content += ' 2. :tag:`prototype ` - The item is a prototype and is subject to change .\n '
317+ content += ' 3. :tag:`beta ` - The item is in beta and approaching stability .\n '
318+ content += ' 4. :tag:`deprecated` - The item is deprecated and will be removed in a future release .\n '
319319 content += "\n "
320320
321321 for cls_name in public_classes_names :
Original file line number Diff line number Diff line change @@ -517,6 +517,9 @@ def generate_api_docs_as_docstring(model: Type[BaseModel],
517517 arg_line = f"{ indent } { field_name } ({ type_str } ): "
518518 if status := field_info .get ("status" , None ):
519519 arg_line += f":tag:`{ status } ` "
520+ elif LABEL_STABLE_APIS :
521+ arg_line += f":tag:`stable` "
522+
520523 if field_description :
521524 arg_line += field_description .split ('\n ' )[0 ] # First line with type
522525
@@ -550,6 +553,10 @@ def get_type_repr(cls):
550553 return f"{ module_name } .{ cls .__qualname__ } "
551554
552555
556+ LABEL_STABLE_APIS : bool = True
557+ """ Whether to label the stable APIs with `stable` tags. """
558+
559+
553560class ApiParamTagger :
554561 ''' A helper to tag the api doc according to the status of the fields.
555562 The status is set in the json_schema_extra of the field.
You can’t perform that action at this time.
0 commit comments