Skip to main content

Tools to make language models a bit easier to use

Project description

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>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolslm-0.3.39.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolslm-0.3.39-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file toolslm-0.3.39.tar.gz.

File metadata

  • Download URL: toolslm-0.3.39.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for toolslm-0.3.39.tar.gz
Algorithm Hash digest
SHA256 efd26399d5df640dd4e812f9029528424c69c1cd1781affbd62006eeb6e50ffb
MD5 084668e9ed25fa3b7ce3398102b8eba1
BLAKE2b-256 edafce27b2660c6cdf843bd6bd807035ce9e32bd1b0473bda8833793be27e694

See more details on using hashes here.

File details

Details for the file toolslm-0.3.39-py3-none-any.whl.

File metadata

  • Download URL: toolslm-0.3.39-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for toolslm-0.3.39-py3-none-any.whl
Algorithm Hash digest
SHA256 b3dda022b831a499aa358216eec32f0c12235d12ead0f789a09211fde5bb862a
MD5 87bf3401ed2dc9ff448e1dfb85da833a
BLAKE2b-256 84299e90e17535a1f023ee64c7807f135f81066298bef21696c0deafa90b2392

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page