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 @@ -550,6 +550,10 @@ def get_type_repr(cls):
550550 return f"{ module_name } .{ cls .__qualname__ } "
551551
552552
553+ LABEL_STABLE_APIS : bool = True
554+ """ Whether to label the stable APIs with `stable` tags. """
555+
556+
553557class ApiParamTagger :
554558 ''' A helper to tag the api doc according to the status of the fields.
555559 The status is set in the json_schema_extra of the field.
@@ -567,6 +571,9 @@ def _process_pydantic_model(self, cls: Type[BaseModel]) -> None:
567571 status = field_info .json_schema_extra ['status' ]
568572 self ._amend_pydantic_field_description_with_tags (
569573 cls , [field_name ], status )
574+ elif LABEL_STABLE_APIS :
575+ self ._amend_pydantic_field_description_with_tags (
576+ cls , [field_name ], "stable" )
570577
571578 def _amend_pydantic_field_description_with_tags (self , cls : Type [BaseModel ],
572579 field_names : list [str ],
You can’t perform that action at this time.
0 commit comments