mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
feat(agent_session_endpoints): add module constants
This commit is contained in:
parent
2ccf626669
commit
1cadabfc4c
1 changed files with 61 additions and 0 deletions
61
litellm/proxy/agent_session_endpoints/constants.py
Normal file
61
litellm/proxy/agent_session_endpoints/constants.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
"""Shared constants for the agent_session_endpoints module."""
|
||||
|
||||
# Session lifecycle
|
||||
DEFAULT_MAX_SESSION_MINUTES = 60 * 4 # 4 hours
|
||||
DAEMON_HEARTBEAT_DEAD_AFTER_SECONDS = 90
|
||||
RUN_IDLE_TIMEOUT_SECONDS = 60 * 30 # 30 minutes
|
||||
|
||||
# Long-poll for next-run (internal daemon endpoint)
|
||||
NEXT_RUN_LONG_POLL_TIMEOUT_SECONDS = 30
|
||||
NEXT_RUN_POLL_INTERVAL_SECONDS = 0.5
|
||||
|
||||
# SSE event stream
|
||||
SSE_KEEPALIVE_INTERVAL_SECONDS = 15
|
||||
SSE_TERMINAL_QUIESCE_SECONDS = 1.0
|
||||
SSE_POLL_INTERVAL_SECONDS = 0.25
|
||||
|
||||
# Cleanup sweeper
|
||||
CLEANUP_SWEEPER_INTERVAL_SECONDS = 60
|
||||
|
||||
# JWT / auth scope
|
||||
AGENT_RUNTIME_SCOPE = "agent_runtime_internal"
|
||||
AGENT_JWT_SECRET_ENV = "LITELLM_AGENT_JWT_SECRET"
|
||||
AGENT_JWT_ALGORITHM = "HS256"
|
||||
|
||||
# Session statuses
|
||||
SESSION_STATUS_PROVISIONING = "provisioning"
|
||||
SESSION_STATUS_READY = "ready"
|
||||
SESSION_STATUS_BUSY = "busy"
|
||||
SESSION_STATUS_ERROR = "error"
|
||||
SESSION_STATUS_TERMINATED = "terminated"
|
||||
|
||||
SESSION_TERMINAL_STATUSES = {SESSION_STATUS_TERMINATED, SESSION_STATUS_ERROR}
|
||||
SESSION_ACCEPTING_RUN_STATUSES = {SESSION_STATUS_READY, SESSION_STATUS_BUSY}
|
||||
|
||||
# Run statuses
|
||||
RUN_STATUS_QUEUED = "queued"
|
||||
RUN_STATUS_RUNNING = "running"
|
||||
RUN_STATUS_FINISHED = "finished"
|
||||
RUN_STATUS_CANCELLED = "cancelled"
|
||||
RUN_STATUS_ERROR = "error"
|
||||
|
||||
RUN_ACTIVE_STATUSES = {RUN_STATUS_QUEUED, RUN_STATUS_RUNNING}
|
||||
RUN_TERMINAL_STATUSES = {RUN_STATUS_FINISHED, RUN_STATUS_CANCELLED, RUN_STATUS_ERROR}
|
||||
|
||||
# Event types
|
||||
EVENT_TYPE_RUN_STARTED = "run_started"
|
||||
EVENT_TYPE_RUN_FINISHED = "run_finished"
|
||||
EVENT_TYPE_RUN_CANCELLED = "run_cancelled"
|
||||
EVENT_TYPE_RUN_ERROR = "run_error"
|
||||
EVENT_TYPE_USER_MESSAGE = "user_message"
|
||||
|
||||
RUN_TERMINAL_EVENT_TYPES = {
|
||||
EVENT_TYPE_RUN_FINISHED: RUN_STATUS_FINISHED,
|
||||
EVENT_TYPE_RUN_CANCELLED: RUN_STATUS_CANCELLED,
|
||||
EVENT_TYPE_RUN_ERROR: RUN_STATUS_ERROR,
|
||||
}
|
||||
|
||||
# ID prefixes
|
||||
AGENT_ID_PREFIX = "agent_"
|
||||
SESSION_ID_PREFIX = "sess_"
|
||||
RUN_ID_PREFIX = "run_"
|
||||
Loading…
Add table
Reference in a new issue