-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
71 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
API Reference | ||
============= | ||
|
||
Main Entrypoints | ||
---------------- | ||
.. autofunction:: fanoutqa.load_dev | ||
|
||
.. autofunction:: fanoutqa.load_test | ||
|
||
.. autofunction:: fanoutqa.eval.evaluate | ||
|
||
Wikipedia Retrieval | ||
------------------- | ||
.. autofunction:: fanoutqa.wiki_search | ||
|
||
.. autofunction:: fanoutqa.wiki_content | ||
|
||
Models | ||
------ | ||
.. automodule:: fanoutqa.models | ||
:members: | ||
|
||
.. automodule:: fanoutqa.eval.models | ||
:members: | ||
|
||
Baseline Retriever | ||
------------------ | ||
.. automodule:: fanoutqa.retrieval | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
"sphinx_copybutton", # https://sphinx-copybutton.readthedocs.io/en/latest/ | ||
"sphinxemoji.sphinxemoji", # https://sphinxemojicodes.readthedocs.io/en/stable/ | ||
"sphinx_sitemap", # https://sphinx-sitemap.readthedocs.io/en/latest/getting-started.html | ||
"myst_parser", # https://myst-parser.readthedocs.io/en/stable/intro.html | ||
] | ||
|
||
templates_path = ["_templates"] | ||
|
@@ -45,7 +46,7 @@ | |
html_extra_path = ["_extra"] | ||
# html_logo = "_static/[email protected]" | ||
# html_favicon = "_extra/favicon.ico" | ||
# html_baseurl = "https://kani.readthedocs.io/en/latest/" | ||
html_baseurl = "https://fanoutqa.com/en/latest/" | ||
|
||
nitpicky = True | ||
nitpick_ignore_regex = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,8 @@ | ||
kani (カニ) | ||
=========== | ||
|
||
kani (カニ) is a lightweight and highly hackable framework for chat-based language models with tool usage/function | ||
calling. | ||
|
||
Compared to other LM frameworks, kani is less opinionated and offers more fine-grained customizability | ||
over the parts of the control flow that matter, making it the perfect choice for NLP researchers, hobbyists, and | ||
developers alike. | ||
|
||
kani comes with support for OpenAI models and LLaMA v2 out of the box, with a model-agnostic framework to add support | ||
for many more. | ||
|
||
Features | ||
-------- | ||
|
||
- **Lightweight and high-level** - kani implements common boilerplate to interface with language models without forcing | ||
you to use opinionated prompt frameworks or complex library-specific tooling. | ||
- **Model agnostic** - kani provides a simple interface to implement: token counting and completion generation. | ||
Implement these two, and kani can run with any language model. | ||
- **Automatic chat memory management** - Allow chat sessions to flow without worrying about managing the number of | ||
tokens in the history - kani takes care of it. | ||
- **Function calling with model feedback and retry** - Give models access to functions in just one line of code. | ||
kani elegantly provides feedback about hallucinated parameters and errors and allows the model to retry calls. | ||
- **You control the prompts** - There are no hidden prompt hacks. We will never decide for you how to format your own | ||
data, unlike other popular language model libraries. | ||
- **Fast to iterate and intuitive to learn** - With kani, you only write Python - we handle the rest. | ||
- **Asynchronous design from the start** - kani can scale to run multiple chat sessions in parallel easily, without | ||
having to manage multiple processes or programs. | ||
|
||
Quickstart | ||
---------- | ||
kani requires Python 3.10 or above. | ||
|
||
First, install the library. In this quickstart, we'll use the OpenAI engine, though kani is model-agnostic. | ||
|
||
.. code-block:: console | ||
$ pip install "kani[openai]" | ||
Then, let's use kani to create a simple chatbot using ChatGPT as a backend. | ||
|
||
.. code-block:: python | ||
# import the library | ||
from kani import Kani, chat_in_terminal | ||
from kani.engines.openai import OpenAIEngine | ||
# Replace this with your OpenAI API key: https://platform.openai.com/account/api-keys | ||
api_key = "sk-..." | ||
# kani uses an Engine to interact with the language model. You can specify other model | ||
# parameters here, like temperature=0.7. | ||
engine = OpenAIEngine(api_key, model="gpt-3.5-turbo") | ||
# The kani manages the chat state, prompting, and function calling. Here, we only give | ||
# it the engine to call ChatGPT, but you can specify other parameters like system_prompt="You are..." here. | ||
ai = Kani(engine) | ||
# kani comes with a utility to interact with a kani through your terminal! Check out | ||
# the docs for how to use kani programmatically. | ||
chat_in_terminal(ai) | ||
kani makes the time to set up a working chat model short, while offering the programmer deep customizability over | ||
every prompt, function call, and even the underlying language model. | ||
|
||
To learn more about how to customize kani with your own prompt wrappers, function calling, and more, read on! | ||
|
||
Hands-on examples are available in the `kani repository <https://github.com/zhudotexe/kani/tree/main/examples>`_. | ||
.. include:: ../README.md | ||
:parser: myst_parser.sphinx_ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Docs | ||
|
||
install | ||
kani | ||
function_calling | ||
customization | ||
engines | ||
advanced | ||
api_reference | ||
engine_reference | ||
genindex | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Community | ||
|
||
community/contributing | ||
community/extensions | ||
community/showcase | ||
Discord <https://discord.gg/eTepTNDxYT> | ||
genindex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters