Skip to content

magic-python-toolbox/mxlm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mxlm: Language Model Utils

▮ Features

  • chat_api: A simple object-oriented wrapper for the OpenAI chat API.
    • Supports caching chat requests to avoid starting over in case of errors.
    • Supports the more powerful legacy completions API, compatible with openai versions >= 1.0.
  • .chat.md format:
    • A multi-turn dialogue format based on markdown, capable of converting to and from OpenAI messages JSON.
    • Modify and annotate multi-turn dialogue data using your favorite editor.
    • Maintain MD format, what you see is what you get while editing.
<!--<|BOT|>--><hr></hr><hr></hr> Here you can put the `tag`, must be one line. Could be str or JSON.
## system
You are a helpful assistant.

<!--<|BOT|>--><hr></hr><hr></hr>
## user  
Summarize the content in this url: 
https://XXX.html

<!--<|BOT|>--><hr></hr><hr></hr> {"url":"XXX.html", "title":"XXX"}
## system
Text from url https://XXX.html: ...

<!--<|BOT|>--><hr></hr><hr></hr>
## comment
Multi-line comments.  
Visible to humans but invisible to models.

▮ Usage

pip install mxlm

The __main__ section at the bottom of the source code provides usage instructions and example code.

Releases

No releases published

Packages

No packages published

Languages