Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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.
FAQs
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.
We found that aigist demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.