Skip to content

Commit

Permalink
different rules for Authenticated users
Browse files Browse the repository at this point in the history
  • Loading branch information
RGBKnights committed Jan 9, 2025
1 parent cfd9494 commit b5f1142
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions IteratorFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public async Task<string> Iterator_Work([ActivityTrigger] OrchestratorChuck chun

var messages = new List<ChatMessage>()
{
//ChatMessage.CreateSystemMessage(),
ChatMessage.CreateSystemMessage(chunk.Instructions),
ChatMessage.CreateUserMessage(chunk.Value)
};
Expand Down
18 changes: 16 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,27 @@
{
Rules =
[
// Anonymous-10/Day
new ThrottlingTrollRule
{
UriPattern = "/api/Iterator_Start",
LimitMethod = new FixedWindowRateLimitMethod
LimitMethod = new SlidingWindowRateLimitMethod
{
PermitLimit = 10,
IntervalInSeconds = 3600,
IntervalInSeconds = 86400,
NumOfBuckets = 3
},
},
// Authorized-100/Day
new ThrottlingTrollRule
{
UriPattern = "/api/Iterator_Start",
HeaderName = "Authorization",
LimitMethod = new SlidingWindowRateLimitMethod
{
PermitLimit = 100,
IntervalInSeconds = 86400,
NumOfBuckets = 3,
}
}
]
Expand Down

0 comments on commit b5f1142

Please sign in to comment.