Observed since 21 Oct, 10:49 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
This project provides a FastAPI application to create and update GitHub gists using the GitHub API. It includes SQLite for persistence and is designed to run in a GitHub Codespace.
_____ _ _____ _ _
| _ |_| __|_|___| |_
| | | | | |_ -| _|
|__|__|_|_____|_|___|_|
Created by rUv
Ai Gist is python application designed to help you create and manage GitHub gists effortlessly using the GitHub API. With built-in SQLite for persistence and seamless integration with AI language models (LLMs), Ai Gist offers powerful capabilities for automating your workflow.
Get started quickly by installing the application and running the server to leverage these features for an enhanced coding experience.
Create a GitHub Codespace:
Install Dependencies:
Install the Package:
pip install aigist
Initialize the Database:
python init_db.py
Run the Application:
aigist
GITHUB_TOKEN: Your GitHub token.LITELLM_API_BASE: The base URL for the LiteLLM API.LITELLM_API_KEY: Your LiteLLM API key.LITELLM_MODEL: The model to use for LiteLLM (e.g., gpt-4o-2024-05-1).Create Gist: POST /gists
{
"description": "Sample Gist",
"public": true,
"files": [
{
"filename": "sample.txt",
"content": "This is a sample gist content."
}
]
}
Update Gist: PATCH /gists/{gist_id}
{
"description": "Updated Sample Gist",
"files": [
{
"filename": "sample.txt",
"content": "This is the updated sample gist content."
}
]
}
List Gists: GET /gists
page: The page number (default: 1).per_page: The number of gists per page (default: 30, max: 100).since: Filter gists created after this date (ISO 8601 format).until: Filter gists created before this date (ISO 8601 format).Chat Completion: POST /chat
{
"messages": [
{
"role": "user",
"content": "Your message here"
}
],
"stream": false
}
Chat Gist: POST /chat/gist
{
"messages": [
{
"role": "user",
"content": "Your message here"
}
],
"stream": false
}
Run the tests using pytest:
pytest
To ensure the database and table setup is correct, run the init_db.py script:
python init_db.py
Create Gist:
{
"description": "Sample Gist",
"public": true,
"files": [
{
"filename": "sample.txt",
"content": "This is a sample gist content."
}
]
}
Update Gist:
{
"description": "Updated Sample Gist",
"files": [
{
"filename": "sample.txt",
"content": "This is the updated sample gist content."
}
]
}
The chat system leverages LiteLLM to interpret user messages and perform actions based on the responses. The endpoint /chat/gist handles incoming chat requests, processes them through LiteLLM, and performs actions such as creating or updating gists based on the responses.
/chat/gist receives a POST request with a list of chat messages.chat_completion function sends these messages to the LiteLLM API using the GPT-4o model.action field in the response, the endpoint either creates or updates a gist.LiteLLM offers numerous features that streamline interaction with various LLM providers:
For more details, refer to the LiteLLM documentation.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.4 | 26 May 2024 | 7 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 10:49 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e999d4fefe65b2082642f2898333b03f0946651a457b050467e48eb1f6420fa3