Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic to log consumption of the openAI tokens and successful diagram's generation requests #66

Merged

Conversation

kislerdm
Copy link
Owner

@kislerdm kislerdm commented Apr 9, 2023

What changed

  • Persistence layer's DDL adjusted:
    • Prediction and raw prediction, tokens
    • Users table
    • API tokens table
    • Successful diagram generation tracking table

Why do we need it

  • To keep costs under control
  • To prepare for users authentication
  • To prepare for quote tracking

@kislerdm kislerdm added the backend Core logic label Apr 9, 2023
@kislerdm kislerdm added this to the v0.0.6 milestone Apr 9, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2023

Codecov Report

Merging #66 (4f3fa63) into master (b55848a) will increase coverage by 0.78%.
The diff coverage is 96.96%.

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage   89.70%   90.48%   +0.78%     
==========================================
  Files          15       15              
  Lines        1078     1167      +89     
==========================================
+ Hits          967     1056      +89     
  Misses         89       89              
  Partials       22       22              
Flag Coverage Δ
cmd-httpserver ∅ <ø> (∅)
pkg-gcpsecretsmanager 77.35% <ø> (ø)
pkg-httpclient 100.00% <ø> (ø)
pkg-openai 90.95% <90.90%> (+1.33%) ⬆️
pkg-postgres 93.95% <100.00%> (+2.95%) ⬆️
root 89.69% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/core/pkg/openai/openai.go 90.95% <90.90%> (+1.33%) ⬆️
server/core/config/config.go 100.00% <100.00%> (ø)
server/core/diagram/c4container/c4container.go 95.08% <100.00%> (+0.63%) ⬆️
server/core/diagram/input.go 95.83% <100.00%> (ø)
server/core/diagram/ports.go 100.00% <100.00%> (ø)
server/core/pkg/postgres/postgres.go 93.95% <100.00%> (+2.95%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kislerdm kislerdm merged commit a86f8cd into master Apr 9, 2023
@kislerdm kislerdm deleted the 55-as-the-service-provider-i-want-to-keep-costs-under-control branch April 9, 2023 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Core logic
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants