A tool to annotate code using the Mistral API
Project description
Code Annotator
Code Annotator
is a Python package designed to automatically add comments to source code using the Mistral AI API. It enables users to quickly obtain comprehensive, context-aware comments throughout their code, facilitating better understanding and readability.
Installation
To install Code Annotator
, you can use pip:
pip install code_annotator
Usage
As a Command Line Tool
After installation, Code Annotator
can be used directly from the command line.
Example:
code-annotator <api_token> <model_name> <file_path> [--temperature] [--top_p] [--max_tokens]
api_token
: Your Mistral API token.model_name
: The name of the Mistral model to use.file_path
: The path to the source code file you want to annotate.temperature
(optional): The temperature parameter for the AI model.top_p
(optional): The top_p parameter for the AI model.max_tokens
(optional): The maximum number of tokens for the AI model to generate.
Customizing Your Annotations
You can customize the behavior of Code Annotator
by adjusting the optional command-line parameters, such as the temperature, top_p, max_tokens, etc., to fit the specific needs of your code or to tweak the behavior of the Mistral model.
Output Example
When you run Code Annotator
, it processes your source code file and adds insightful, context-aware comments to the code. Here is an example of the annotated code output:
# Example of annotated code
def example_function(param1, param2):
# This function performs a calculation using param1 and param2
result = param1 + param2
return result
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for code_annotator-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0cddfbad5a6214874897f3ccb6e59f8e7b4f06a19d3f37e0b36e01dd7a6a0a0 |
|
MD5 | 1cd14d902df1177501632bb2b4b944e1 |
|
BLAKE2b-256 | 9486c35611bc02a430136c5ca32273cc3f8020f6bdfc5d4963a08c24178359d1 |