[swarms.utils][docs not foun]

pull/336/head
Kye 1 year ago
parent fb7ca3781d
commit c11a2f467c

@ -0,0 +1,12 @@
- pdf_to_text: "swarms/utils/pdf_to_text.md"
- load_model_torch: "swarms/utils/load_model_torch.md"
- metrics_decorator: "swarms/utils/metrics_decorator.md"
- prep_torch_inference: "swarms/utils/prep_torch_inference.md"
- find_image_path: "swarms/utils/find_image_path.md"
- print_class_parameters: "swarms/utils/print_class_parameters.md"
- extract_code_from_markdown: "swarms/utils/extract_code_from_markdown.md"
- check_device: "swarms/utils/check_device.md"
- display_markdown_message: "swarms/utils/display_markdown_message.md"
- phoenix_tracer: "swarms/utils/phoenix_tracer.md"
- limit_tokens_from_string: "swarms/utils/limit_tokens_from_string.md"
- math_eval: "swarms/utils/math_eval.md"

@ -112,20 +112,18 @@ nav:
- PGVectorStore: "swarms/memory/pg.md"
- ShortTermMemory: "swarms/memory/short_term_memory.md"
- swarms.utils:
- phoenix_trace_decorator: "swarms/utils/phoenix_tracer.md"
- pdf_to_text: "swarms/utils/pdf_to_text.md"
- load_model_torch: "swarms/utils/load_model_torch.md"
- metrics_decorator: "swarms/utils/metrics_decorator.md"
- prep_torch_inference: "swarms/utils/prep_torch_inference.md"
- find_image_path: "swarms/utils/find_image_path.md"
- print_class_parameters: "swarms/utils/print_class_parameters.md"
- extract_code_from_markdown: "swarms/utils/extract_code_from_markdown.md"
- check_device: "swarms/utils/check_device.md"
- display_markdown_message: "swarms/utils/display_markdown_message.md"
- phoenix_tracer: "swarms/utils/phoenix_tracer.md"
- limit_tokens_from_string: "swarms/utils/limit_tokens_from_string.md"
- math_eval: "swarms/utils/math_eval.md"
- pdf_to_text: "pdf_to_text.md"
- load_model_torch: "load_model_torch.md"
- metrics_decorator: "metrics_decorator.md"
- prep_torch_inference: "prep_torch_inference.md"
- find_image_path: "find_image_path.md"
- print_class_parameters: "print_class_parameters.md"
- extract_code_from_markdown: "extract_code_from_markdown.md"
- check_device: "check_device.md"
- display_markdown_message: "display_markdown_message.md"
- phoenix_tracer: "phoenix_tracer.md"
- limit_tokens_from_string: "limit_tokens_from_string.md"
- math_eval: "math_eval.md"
- Guides:
- Overview: "examples/index.md"
- Agents:

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "swarms"
version = "2.6.1"
version = "3.1.0"
description = "Swarms - Pytorch"
license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"]

@ -1,5 +1,6 @@
import os
def generate_file_list(directory, output_file):
"""
Generate a list of files in a directory in the specified format and write it to a file.
@ -8,16 +9,21 @@ def generate_file_list(directory, output_file):
directory (str): The directory to list the files from.
output_file (str): The file to write the output to.
"""
with open(output_file, 'w') as f:
with open(output_file, "w") as f:
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.md'):
if file.endswith(".md"):
# Remove the directory from the file path and replace slashes with dots
file_path = os.path.join(root, file).replace(directory + '/', '').replace('/', '.')
file_path = (
os.path.join(root, file)
.replace(directory + "/", "")
.replace("/", ".")
)
# Remove the file extension
file_name, _ = os.path.splitext(file)
# Write the file name and path to the output file
f.write(f"- {file_name}: \"{file_path}\"\n")
f.write(f'- {file_name}: "swarms/utils/{file_path}"\n')
# Use the function to generate the file list
generate_file_list('docs/swarms/utils', 'file_list.txt')
generate_file_list("docs/swarms/utils", "file_list.txt")

Loading…
Cancel
Save