docs with better footers and headers

This commit is contained in:
Jason
2023-07-11 17:40:42 +08:00
parent db906e3176
commit fbcba9e5cb
2 changed files with 24 additions and 5 deletions
+14 -5
View File
@@ -1,10 +1,21 @@
# Philosophy
The philosophy behind this library is to provide a lightweight and flexible approach to leveraging language models (LLMs) structured output without imposing unnecessary dependencies or abstractions. Here are some key points to understand:
The philosophy behind this library is to provide a **lightweight** and **flexible** approach to leveraging language models (LLMs) to do **structured output without imposing unnecessary dependencies or abstractions.**
* **Minimal Installation:** This library is designed to be lightweight. If you prefer not to install the library and its two dependencies, you can simply extract the `function_calls.py` file from the code and incorporate it directly into your project. Own it. Its a single script.
By treating LLMs as just another function that returns a typed object, this library aims to remove the perceived complexity and make working with LLMs more approachable. It provides a flexible foundation for incorporating LLMs into your projects while allowing you to leverage the full power of Python to write your own code.
* **Experimental DSL:** The library also includes an experimental prompt pipeline api. The DSL is a thin wrapper that aims to improve code readability by adding light abstraction around templates as messages. It provides a slightly more syntax for working with LLMs, making the prompting easier to read.
1. Define a Schema `#!python class StructuredData(OpenAISchema):`
2. Excapsulate all your LLM logic into a function `#!python def extract(a) -> StructuredData:`
3. Define typed computations against your data with `#!python def compute(data: StructuredData):`
Here are some key points to understand:
* **Minimal Installation:** This library is designed to be lightweight. If you prefer not to install the library and its two dependencies, you can simply extract the `function_calls.py` file from the code and incorporate it directly into your project. Own it. Its a single script.
* **Code as prompts:** With both the DSL and the structured extraction we don't make a distinction between a code vs a `prompt template`. We believe the prompts that go into a LLM should be constructed and colocated with the code we need to execute. Prompts are created via docstrings, descriptions and functions that construct messages.
* **Writing Prompts:** The library also includes an experimental prompt pipeline api. The DSL is a thin wrapper that aims to improve code readability by adding light abstraction around templates as messages. It provides a slightly more syntax for working with LLMs, making the prompting easier to read.
* **No Abstractions for Retrieval or Execution:** The library does not impose any abstractions for retrieval or execution. Python code is considered to great glue code, and there is no need to force the use of additional abstractions. You have the freedom to use any retrieval or execution mechanism that suits your needs.
@@ -62,8 +73,6 @@ The philosophy behind this library is to provide a lightweight and flexible appr
# )
```
By treating LLMs as just another function that returns a typed object, this library aims to remove the perceived complexity and make working with LLMs more approachable. It provides a flexible foundation for incorporating LLMs into your projects while allowing you to leverage the full power of Python as a glue language.
Please note that the library is designed to be adaptable and open-ended, allowing you to customize and extend its functionality based on your specific requirements.
If you have any further questions or ideas hit me up on [twitter](https://twitter.com/jxnlco)
+10
View File
@@ -13,8 +13,12 @@ theme:
- navigation.tabs.sticky
- navigation.expand
- content.code.annotate
- navigation.footer
- search.suggest
- search.highlight
plugins:
- social
- search
- mkdocstrings:
handlers:
python:
@@ -57,3 +61,9 @@ extra:
analytics:
provider: google
property: G-5CR8QXF5CN
social:
- icon: fontawesome/brands/twitter
link: https://twitter.com/jxnlco
- icon: fontawesome/brands/github
link: https://github.com/jxnl
copyright: Copyright © 2023 Jason Liu