-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/friction less onboarding and usage reporting (#256)
* Intial commit * Updated the admin page * Fritcionless onbaodring changes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated the authenication helper * Historical model fix in migration * added adapter identfiers * Made token_usage table tenant specific * Updated the migrations * Validating adapter state in prompt and workflow run * Validating adapter state in prompt and workflow run * Added method for usage in pusbsub helper * Removed organization_id field from token_usage table * Made admin page as plugin * usage table changes * Pass adapter_instance_id to run_completion function * Updated field model_type -> model_name * added description for adapters * Added the error messages * Updated serilizer to display description * Updated organziation with token limit * Support description for adapters * Save total token usage * resolved conflict * Implemented the SocketMessages component globally * Minor fix * Rverted the git ignore * Reverted the git ignore * Correct the error message * Make token usage 0 if negative * SDk version bump * Review comment fixes * Update backend/adapter_processor/models.py Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Signed-off-by: Rahul Johny <116638720+johnyrahul@users.noreply.github.com> * Addressed the review comments --------- Signed-off-by: Rahul Johny <116638720+johnyrahul@users.noreply.github.com> Signed-off-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com> Co-authored-by: Deepak <deepak@zipstack.com> Co-authored-by: Tahier Hussain <tahier@zipstack.com> Co-authored-by: Neha <115609453+nehabagdia@users.noreply.github.com> Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
- Loading branch information
1 parent
d410553
commit 9d49cdb
Showing
54 changed files
with
687 additions
and
216 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
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
20 changes: 20 additions & 0 deletions
20
backend/account/migrations/0007_organization_allowed_token_limit.py
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,20 @@ | ||
# Generated by Django 4.2.1 on 2024-04-25 07:55 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("account", "0006_delete_encryptionsecret"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="organization", | ||
name="allowed_token_limit", | ||
field=models.IntegerField( | ||
db_comment="token limit set in case of frition less onbaoarded org", | ||
default=-1, | ||
), | ||
), | ||
] |
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
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
41 changes: 41 additions & 0 deletions
41
backend/adapter_processor/migrations/0008_adapterinstance_description_and_more.py
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,41 @@ | ||
# Generated by Django 4.2.1 on 2024-04-29 05:16 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"adapter_processor", | ||
"0007_remove_adapterinstance_is_default_userdefaultadapter", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="adapterinstance", | ||
name="description", | ||
field=models.TextField(blank=True, default=None, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="adapterinstance", | ||
name="is_friction_less", | ||
field=models.BooleanField( | ||
db_comment="Was the adapter created through frictionless onboarding", | ||
default=False, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="adapterinstance", | ||
name="is_usable", | ||
field=models.BooleanField(db_comment="Is the Adpater Usable", default=True), | ||
), | ||
migrations.AddField( | ||
model_name="adapterinstance", | ||
name="shared_to_org", | ||
field=models.BooleanField( | ||
db_comment="Is the adapter shared to entire org", default=False | ||
), | ||
), | ||
] |
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
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
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
Oops, something went wrong.