-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Depends on #1334
Depends on #1336
Now that we have a relationship between tool calls and a "parent" interception has been established (agentic thread), we must provide an APIs to retrieve these.
Sessions are sets of interceptions (#1336) or threads.
Threads are special sets of interceptions whereby an initial prompt kicked off an agent loop involving one or more tool calls.
Agentic loop:
1. Client: Prompt
↓
2. Server: LLM decides to use tool call
↓
3. Client: Invokes tool call, sends tool result
↓
4. Server: receives tool result, performs next inference
- if terminal state → done
- if another tool call required → go to 2
A thread is not an actual record, it's a logical grouping of multiple interception records.
If a session ID is not present for an interception, the individual interception should be treated as a session with a single interception and the session ID = interception ID.
Acceptance criteria:
- Added API endpoints with same filters as
/api/v2/aibridge/interceptions(plus session ID), and pagination-
GET /api/v2/aibridge/threads/by-session(we'll use this for the new listing page) -
GET /api/v2/aibridge/sessions/:id/threads(just an alias forGET /api/v2/aibridge/threads/by-session?session-id={id}, displaying only a single session - no list) -
GET /api/v2/aibridge/threads/:id- Database queries added to facilitate these
-
- Tests added
GET /api/v2/aibridge/threads/by-session
{
"count": 99,
"sessions": [
{
"session_id": "session_id|interception_id",
"threads": [
{
"api_key_id": "string",
"started_at": "2019-08-24T14:15:22Z", // started_at of first interception
"ended_at": "2019-08-24T14:15:22Z", // ended_at of last interception
"provider": "string",
"models": ["string", "string"],
"prompt": "string",
"initiator": {
"avatar_url": "http://example.com",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"username": "string"
},
"tokens_total": {
"input": 123, // input + cache reads
"output": 456
},
"tool_calls_total": 5
}
]
}
]
}TODO: add other API response payloads
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels