toolslm

Tools to make language models a bit easier to use

Apache-2.0 52 个版本 Python >=3.9
安装
pip install toolslm
poetry add toolslm
pipenv install toolslm
conda install toolslm
描述

toolslm

This is a work in progress…

Install

pip install toolslm

How to use

Context creation

toolslm has some helpers to make it easier to generate XML context from files, for instance folder2ctx:

print(folder2ctx('samples', prefix=False, file_glob='*.py'))
<documents><document index="1"><src>
samples/sample_core.py
</src><document-content>
import inspect
empty = inspect.Parameter.empty
models = 'claude-3-opus-20240229','claude-3-sonnet-20240229','claude-3-haiku-20240307'
</document-content></document></documents>

JSON doesn’t map as nicely to XML as the ft data structure from fastcore.xml, but for simple XML trees it can be convenient. The json_to_xml function handles that conversion:

a = dict(surname='Howard', firstnames=['Jeremy','Peter'],
         address=dict(state='Queensland',country='Australia'))
print(json_to_xml(a, 'person'))
<person>
  <surname>Howard</surname>
  <firstnames>
    <item>Jeremy</item>
    <item>Peter</item>
  </firstnames>
  <address>
    <state>Queensland</state>
    <country>Australia</country>
  </address>
</person>
版本列表
0.3.39 2026-06-22
0.3.38 2026-05-21
0.3.37 2026-05-04
0.3.36 2026-04-16
0.3.35 2026-04-13
0.3.34 2026-03-27
0.3.33 2026-03-12
0.3.32 2026-03-08
0.3.31 2026-02-23
0.3.30 2026-02-14
0.3.29 2026-02-13
0.3.28 2026-02-05
0.3.27 2026-02-02
0.3.26 2026-01-21
0.3.25 2026-01-21
0.3.24 2026-01-15
0.3.23 2026-01-14
0.3.22 2026-01-11
0.3.20 2026-01-09
0.3.19 2026-01-08
0.3.18 2026-01-05
0.3.17 2026-01-02
0.3.16 2025-12-30
0.3.14 2025-12-29
0.3.13 2025-12-26
0.3.12 2025-12-26
0.3.11 2025-12-25
0.3.10 2025-12-25
0.3.9 2025-12-24
0.3.8 2025-12-24
0.3.7 2025-12-24
0.3.6 2025-12-13
0.3.5 2025-12-13
0.3.4 2025-09-23
0.3.3 2025-09-23
0.3.2 2025-06-30
0.3.1 2025-06-30
0.3.0 2025-06-29
0.2.3 2025-06-23
0.2.2 2025-06-21
0.2.1 2025-05-21
0.2.0 2025-04-28
0.1.3 2025-04-17
0.1.2 2025-04-07
0.1.1 2025-03-29
0.1.0 2024-12-17
0.0.7 2024-10-23
0.0.6 2024-09-10
0.0.5 2024-08-21
0.0.4 2024-08-14
0.0.3 2024-05-05
0.0.2 2024-05-05