-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c94fd91
commit 7ad58d6
Showing
12 changed files
with
277 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
release-on-push: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- id: release | ||
uses: rymndhng/release-on-push-action@master | ||
with: | ||
bump_version_scheme: minor | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ steps.release.outputs.tag_name }} | ||
|
||
- name: deploy | ||
env: | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
VERSION_NUMBER: ${{ steps.release.outputs.tag_name }} | ||
run: | | ||
echo "Deploying ${{ steps.release.outputs.tag_name }} to PyPI" | ||
pip install twine | ||
python setup.py sdist | ||
twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD |
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,35 @@ | ||
.. image:: https://img.shields.io/badge/chatGPT-74aa9c.svg?logo=openai | ||
.. image:: https://img.shields.io/pypi/pyversions/setuptools.svg | ||
|
||
================== | ||
OpenAI Cost Logger | ||
================== | ||
|
||
Simple cost logger for OpenAI requests. | ||
Track the cost of every request you make to OpenAI and visualize them in a user-friendly way. | ||
|
||
How to install: | ||
--------------- | ||
* .. code-block:: python | ||
|
||
pip install openai-cost-logger | ||
|
||
* .. code-block:: python | ||
|
||
from openai_cost_logger.constants import DEFAULT_LOG_PATH, Models, MODELS_COST | ||
from openai_cost_logger.openai_cost_logger_viz import OpenAICostLoggerViz | ||
from openai_cost_logger.openai_cost_logger_utils import OpenAICostLoggerUtils | ||
from openai_cost_logger.openai_cost_logger import OpenAICostLogger | ||
|
||
* See also the homepage on `PyPI <https://pypi.org/project/openai-cost-logger/>`_. | ||
* See the `demo file <https://github.com/drudilorenzo/track-openai-cost/blob/master/demo.ipynb>`_ for a usage example. | ||
|
||
Key Features: | ||
------------- | ||
* Track the cost of every request you make to OpenAI and save them in a csv file. | ||
* Visualize the cost of all the requests you have made. | ||
|
||
Endpoint supported: | ||
------------------- | ||
* Chat completion. | ||
* Every endpoint which response contains the field "*usage.prompt_tokens*" and "*usage.completion_tokens*". |
Oops, something went wrong.