Metadata-Version: 2.4
Name: contextkit
Version: 0.0.8
Summary: Reusable contexts for LLMs
Home-page: https://github.com/AnswerDotAI/contextkit
Author: Isaac Flath
Author-email: isaac.flath@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-fasthtml
Requires-Dist: httpx
Requires-Dist: toolslm
Requires-Dist: fastcore
Requires-Dist: llms-txt
Requires-Dist: pypdf
Requires-Dist: youtube_transcript_api
Requires-Dist: pytube
Requires-Dist: playwrightnb
Provides-Extra: dev
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# contextkit


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

    pip install contextkit

### Using

To get context from an LLM, use one of the helper functions to pull it.

If a function pulls a single context snippit it will return the text, if
it return multiple it will return a dictionary.

``` python
import contextkit.read as rd
```

#### Read_X Functions

Each `read_x` function is designed to work with a single argument, which
is the location of the resource. This typically means a URL or a file
path.

``` python
rd.read_url('https://www.answer.ai/')[:200]
```

    'Answer.AI\n\n  * __\n  * __\n\n# Answer.AI - Practical AI R&D\n\n##### Categories\n\nAll (33)\n\nai (20)\n\ncoding (5)\n\ncompany (2)\n\ncourses (1)\n\neducation (1)\n\ninterview (1)\n\nopen-source (14)\n\npolicy (4)\n\nproduct'

Other arguments are always optional, but can be useful at times. For
example, the `heavy` argument in
[`read_url`](https://AnswerDotAI.github.io/contextkit/read.html#read_url)
allows you to do a heavy scrape with a contactless browser using
`playwrightnb`.

``` python
rd.read_url('https://www.answer.ai/',heavy=True)[:200]
```

    'Answer.AI\n\n  * __\n  * __\n\n# Answer.AI - Practical AI R&D\n\n##### Categories\n\nAll (33)\n\nai (20)\n\ncoding (5)\n\ncompany (2)\n\ncourses (1)\n\neducation (1)\n\ninterview (1)\n\nopen-source (14)\n\npolicy (4)\n\nproduct'

Many have been creates so far, such as

``` python
[o for o in dir(rd) if o.startswith('read_')]
```

    ['read_dir',
     'read_file',
     'read_gdoc',
     'read_gh_file',
     'read_gh_repo',
     'read_gist',
     'read_git_path',
     'read_google_sheet',
     'read_html',
     'read_pdf',
     'read_url',
     'read_yt_transcript']
