Download packages/agent-core-v2/src/features/tokenCounting/tokenCountingFeature.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 832 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/features/tokenCounting/tokenCountingFeature.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/features/tokenCounting/tokenCountingFeature.ts
-
curl -L -o tokenCountingFeature.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/features/tokenCounting/tokenCountingFeature.ts
832 Bytes
| import { LifecycleScope } from '#/app/scopes'; | |
| import { Feature } from '#/features/feature'; | |
| import { registerFeature } from '#/features/featureRegistry'; | |
| import { ISessionTokenCountingService } from '#/session/tokenCounting/sessionTokenCounting'; | |
| import { SessionTokenCountingService } from '#/session/tokenCounting/sessionTokenCountingService'; | |
| import { TokenCountingAgentModelDefinition } from '#/session/tokenCounting/tokenCountingAgentModel'; | |
| export class TokenCountingFeature extends Feature { | |
| static override readonly name = 'tokenCounting'; | |
| constructor() { | |
| super(); | |
| this.contributeAgentModel(TokenCountingAgentModelDefinition); | |
| this.contributeService( | |
| LifecycleScope.Session, | |
| ISessionTokenCountingService, | |
| SessionTokenCountingService, | |
| ); | |
| } | |
| } | |
| registerFeature(TokenCountingFeature); | |