A couple of fixes for the docs generator (#524)
Display "This tool does not take any parameters." when the tool interface has no arguments other than context. Prevent the same Enum from being referenced multiple times in the reference.mdx file.
This commit is contained in:
parent
02a0900846
commit
21f892c0a0
1 changed files with 7 additions and 0 deletions
|
|
@ -121,8 +121,12 @@ def build_reference_mdx(
|
|||
enum_mdx_template: str = ENUM_MDX,
|
||||
) -> str:
|
||||
enum_items = ""
|
||||
enum_names_seen = set()
|
||||
|
||||
for enum_name, enum_class in referenced_enums:
|
||||
if enum_name in enum_names_seen:
|
||||
continue
|
||||
enum_names_seen.add(enum_name)
|
||||
enum_items += enum_item_template.format(
|
||||
enum_name=enum_name,
|
||||
enum_values=build_enum_values(
|
||||
|
|
@ -246,6 +250,9 @@ def build_tool_spec(
|
|||
tool_parameter_template=tool_parameter_template,
|
||||
)
|
||||
|
||||
if not parameters:
|
||||
parameters = "This tool does not take any parameters."
|
||||
|
||||
secrets = (
|
||||
build_tool_secrets(
|
||||
secrets=tool.requirements.secrets,
|
||||
|
|
|
|||
Loading…
Reference in a new issue