Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
23645ee3
Commit
23645ee3
authored
Jan 03, 2025
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into hidden-icon
parents
28db12bf
237fd0be
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
CHANGELOG.md
CHANGELOG.md
+7
-0
BehaviorTests.java
src/test/java/com/owlmaddie/tests/BehaviorTests.java
+0
-0
RateLimiter.java
src/test/java/com/owlmaddie/utils/RateLimiter.java
+24
-0
No files found.
CHANGELOG.md
View file @
23645ee3
...
...
@@ -6,6 +6,13 @@ All notable changes to **CreatureChat** are documented in this file. The format
## Unreleased
### Added
-
Rate limiter for LLM unit tests (to prevent rate limit issues from certain providers when running all tests)
-
Check friendship direction (+ or -) in LLM unit tests (to verify friendship is output correctly)
### Changed
-
Improved LLM unit tests to check for both a positive and negative behaviors (i.e. FOLLOW and not LEAD, ATTACK and not FLEE, etc...)
### Fixed
-
Changing death message timestamp output to use DEBUG log level
...
...
src/test/java/com/owlmaddie/tests/BehaviorTests.java
View file @
23645ee3
This diff is collapsed.
Click to expand it.
src/test/java/com/owlmaddie/utils/RateLimiter.java
0 → 100644
View file @
23645ee3
package
com
.
owlmaddie
.
utils
;
import
java.util.concurrent.Semaphore
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
/**
* The {@code RateLimiter} class is used to slow down LLM unit tests so we don't hit any rate limits accidentally.
*/
public
class
RateLimiter
{
private
final
Semaphore
semaphore
;
public
RateLimiter
(
int
requestsPerSecond
)
{
semaphore
=
new
Semaphore
(
requestsPerSecond
);
Executors
.
newScheduledThreadPool
(
1
).
scheduleAtFixedRate
(()
->
{
semaphore
.
release
(
requestsPerSecond
-
semaphore
.
availablePermits
());
},
0
,
1
,
TimeUnit
.
SECONDS
);
}
public
void
acquire
()
throws
InterruptedException
{
semaphore
.
acquire
();
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment