MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getChatClient

Function getChatClient

apps/start/src/agents/client.ts:31–40  ·  view source on GitHub ↗
(apiUrl: string)

Source from the content-addressed store, hash-verified

29 * the server reads the session cookie from the request.
30 */
31export function getChatClient(apiUrl: string): AppClient {
32 if (cachedClient && cachedBaseURL === apiUrl) return cachedClient;
33 cachedBaseURL = apiUrl;
34 cachedClient = createClient<ChatApp>({
35 baseURL: `${apiUrl}/ai/agents`,
36 fetch: (input, init) =>
37 fetch(input, { ...init, credentials: 'include' }),
38 });
39 return cachedClient;
40}

Callers 1

ChatRuntimeProviderFunction · 0.90

Calls 2

createClientFunction · 0.85
fetchFunction · 0.50

Tested by

no test coverage detected