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.36.tar.gz (24.6 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.36-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for toolslm-0.3.36.tar.gz
Algorithm Hash digest
SHA256 1c6c2d841a89c16e92d95caf2efaadfb6c0793f47fae8438919b5f4f4dea80d4
MD5 ac66dbefaa6e325321ff84fc1bdffad4
BLAKE2b-256 d1ec79dab6f64730f7dad941cf4fd97c82b001ad364e1a9c5f060f756ab7b57e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for toolslm-0.3.36-py3-none-any.whl
Algorithm Hash digest
SHA256 4d4de7664c56d26af88203ea72b0a8b348fe2a959a4cb9ed0c81cdd89d608f9c
MD5 76e9c071274f29a55ce872bb5d03e719
BLAKE2b-256 52a2ea79c2cf8d8c52b91ef2d85225bb52e699bcbfceaa97b2b3a1f7bb8ba925

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