-
Notifications
You must be signed in to change notification settings - Fork 46
feat(core): semaphore option for limit request #461
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces configurable concurrency control via semaphores in the Agentica and MicroAgentica classes, updates multiple package dependencies to use pnpm catalogs, and extends the IAgenticaVendor interface with a new semaphore
option.
- Added semaphore-based request limits to Agentica and MicroAgentica
- Switched several packages’
tstl
andopenai
deps tocatalog:libs
in package.json and pnpm-workspace - Extended IAgenticaVendor with an optional
semaphore
property and updated docs
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
website/package.json | Switched tstl to catalog:libs |
test/package.json | Switched tstl to catalog:libs |
pnpm-workspace.yaml | Bumped openai , added tstl , updated MCP & Typia plugins |
packages/core/src/structures/IAgenticaVendor.ts | Imported Semaphore , added `semaphore?: Semaphore |
packages/core/src/MicroAgentica.ts | Initialized .semaphore_ , wrapped request calls with acquire/release |
packages/core/src/Agentica.ts | Initialized .semaphore_ , wrapped request calls with acquire/release |
packages/core/package.json | Added tstl: "catalog:libs" dependency |
packages/benchmark/package.json | Switched tstl to catalog:libs |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/core/src/MicroAgentica.ts:97
- Add or update unit tests to cover the new semaphore-based concurrency control logic in
MicroAgentica
.
this.semaphore_ = props.vendor.semaphore != null
@agentica/benchmark
@agentica/chat
agentica
@agentica/core
create-agentica
@agentica/rpc
@agentica/vector-selector
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add peerDependency
Co-authored-by: Copilot <[email protected]>
…into feat/semaphore
Special option for
@autobe
supporting.This pull request introduces enhancements to the
Agentica
andMicroAgentica
classes by adding support for concurrency control using semaphores, updates dependencies across multiple packages, and improves the configuration options for limiting concurrent requests. Additionally, it updates thepnpm-lock.yaml
file to reflect the latest versions of dependencies. Below is a summary of the most important changes grouped by theme.Concurrency Control Enhancements:
Semaphore
instance to theAgentica
andMicroAgentica
classes to manage the number of concurrent requests to the LLM vendor. The semaphore can be shared across agents or configured with a numerical limit. (packages/core/src/Agentica.ts
[1] [2];packages/core/src/MicroAgentica.ts
[3] [4]request
handler in both classes to use the semaphore for controlling concurrent requests, ensuring proper acquisition and release of the semaphore. (packages/core/src/Agentica.ts
[1] [2];packages/core/src/MicroAgentica.ts
[3] [4]Dependency Updates:
tstl
andopenai
dependencies inpackage.json
files to use thecatalog:libs
specifier instead of fixed versions. (packages/benchmark/package.json
[1];packages/core/package.json
[2]openai
,tstl
, and@samchon/openapi
inpnpm-lock.yaml
. (pnpm-lock.yaml
[1] [2] [3]Configuration Improvements:
IAgenticaVendor
interface to include a newsemaphore
property for configuring concurrency limits. This property can accept aSemaphore
instance or a numerical value. (packages/core/src/structures/IAgenticaVendor.ts
packages/core/src/structures/IAgenticaVendor.tsR40-R53)These changes improve the scalability and configurability of the
Agentica
framework while ensuring compatibility with updated dependencies.