( sessionId: string, agentId: string, mode: 'model' | 'full' = 'model', )
| 16 | * cached independently (the mode is part of the React Query key). |
| 17 | */ |
| 18 | export function useContext( |
| 19 | sessionId: string, |
| 20 | agentId: string, |
| 21 | mode: 'model' | 'full' = 'model', |
| 22 | ) { |
| 23 | return useQuery({ |
| 24 | queryKey: ['context', sessionId, agentId, mode] as const, |
| 25 | queryFn: () => api.getContext(sessionId, agentId, mode), |
| 26 | enabled: sessionId.length > 0 && agentId.length > 0, |
| 27 | }); |
| 28 | } |
no test coverage detected