collab: Use a separate Anthropic API key for Zed staff (#16128)
This PR makes it so Zed staff can use a separate Anthropic API key for the LLM service. We also added an `is_staff` column to the `usages` table so that we can exclude staff usage from the "active users" metrics that influence the rate limits. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
ebdde5994d
commit
f3ec8d425f
8 changed files with 47 additions and 11 deletions
|
@ -29,12 +29,12 @@ async fn test_tracking_usage(db: &mut LlmDatabase) {
|
|||
let user_id = 123;
|
||||
|
||||
let now = t0;
|
||||
db.record_usage(user_id, provider, model, 1000, 0, now)
|
||||
db.record_usage(user_id, false, provider, model, 1000, 0, now)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let now = t0 + Duration::seconds(10);
|
||||
db.record_usage(user_id, provider, model, 2000, 0, now)
|
||||
db.record_usage(user_id, false, provider, model, 2000, 0, now)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
@ -66,7 +66,7 @@ async fn test_tracking_usage(db: &mut LlmDatabase) {
|
|||
);
|
||||
|
||||
let now = t0 + Duration::seconds(60);
|
||||
db.record_usage(user_id, provider, model, 3000, 0, now)
|
||||
db.record_usage(user_id, false, provider, model, 3000, 0, now)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
@ -98,7 +98,7 @@ async fn test_tracking_usage(db: &mut LlmDatabase) {
|
|||
}
|
||||
);
|
||||
|
||||
db.record_usage(user_id, provider, model, 4000, 0, now)
|
||||
db.record_usage(user_id, false, provider, model, 4000, 0, now)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue