Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/christian-bromann/langchat
/ functions
Functions
70 in github.com/christian-bromann/langchat
⨍
Functions
70
◇
Types & classes
35
↓ 3 callers
Function
createMockedFetch
* Creates a mocked fetch function that simulates random network request errors * This demonstrates the model fallback middleware by causing the prima
app/agents/model-fallback.ts:11
↓ 3 callers
Function
determineEventTypeFromPayload
(payload: unknown)
app/components/ChatInterface.tsx:1128
↓ 3 callers
Function
handleEvent
(eventType: EventType, eventData: unknown)
app/components/ChatInterface.tsx:1171
↓ 3 callers
Function
transformLangGraphEvent
(langGraphEventType: string, payload: unknown)
app/components/ChatInterface.tsx:977
↓ 2 callers
Function
countTokensApproximately
(messages: BaseMessage[] | Array<Record<string, unknown>>)
app/contexts/StatisticsContext.tsx:12
↓ 2 callers
Function
extractIncrementalTextFromChunk
(msg: unknown)
app/components/ChatInterface.tsx:1288
↓ 2 callers
Function
updateToolCallWithMessage
(toolMsg: ToolMessageData | Record<string, unknown>)
app/components/ChatInterface.tsx:232
↓ 2 callers
Function
useStatistics
()
app/contexts/StatisticsContext.tsx:141
↓ 1 callers
Function
basicAgent
(options: { message: string; apiKey: string; model?: string })
app/agents/basic.ts:26
↓ 1 callers
Function
cloudflareMcpAgent
(options: { message: string; apiKey: string; model?: string; cloudflareApiToken?: string; })
app/agents/cloudflare-mcp.ts:127
↓ 1 callers
Function
contextEditingAgent
(options: { message: string; apiKey: string; model?: string; threadId?: string; })
app/agents/context-editing.ts:85
↓ 1 callers
Function
getInitialMessages
()
app/agents/summarization.ts:102
↓ 1 callers
Function
getIsDark
()
app/components/ThemeSwitcher.tsx:34
↓ 1 callers
Function
getToolMessageInfo
(toolMessage: ToolMessageData | Record<string, unknown>)
app/components/ToolCall.tsx:17
↓ 1 callers
Function
getUserCredits
* Get the number of credits the user has * @param userId - The user ID to get the credits for * @returns The number of credits the user has
app/agents/tool-call-limits.ts:13
↓ 1 callers
Function
hitlAgent
(options: { message: string; apiKey: string; threadId?: string; interruptResponse?: HITLResponse; mo
app/agents/hitl.ts:27
↓ 1 callers
Function
isAIMessageChunk
(chunk: unknown)
app/components/ChatInterface.tsx:22
↓ 1 callers
Function
isToolMessage
(chunk: unknown)
app/components/ChatInterface.tsx:40
↓ 1 callers
Function
mcpServersMiddleware
* Middleware to inject MCP servers configuration into model calls
app/agents/cloudflare-mcp.ts:103
↓ 1 callers
Function
modelCallLimitsAgent
(options: { message: string; apiKey: string; threadLimit?: number; runLimit?: number; exitBehavior?:
app/agents/model-call-limits.ts:60
↓ 1 callers
Function
modelFallbackAgent
(options: { message: string; apiKey: string; threadId?: string; })
app/agents/model-fallback.ts:115
↓ 1 callers
Function
moderationAgent
(options: { message: string; apiKey: string })
app/agents/moderation.ts:8
↓ 1 callers
Function
parseInterruptResponse
* Parses the interrupt response into a format expected by Command * @param interruptResponse - The interrupt response to parse * @returns The parsed
app/api/hitl/route.ts:48
↓ 1 callers
Function
parseSummarizationEvent
(data: UpdateData, currentMessageCount: number, onSummarization: (summary: SummarizationEvent) => void)
app/components/SummarizationBubble.tsx:77
↓ 1 callers
Function
piiRedactionAgent
(options: { message: string; apiKey: string; threadId?: string; model?: string; })
app/agents/pii-redaction.ts:199
↓ 1 callers
Function
processUpdate
(data: UpdateData)
app/components/ChatInterface.tsx:275
↓ 1 callers
Function
readStream
* Reads a stream from the API and calls the callback function for each event. * @param response - The response from the API * @param callback - The
app/components/ChatInterface.tsx:963
↓ 1 callers
Function
simulateNetworkFailure
* Simulate network failures - this will fail initially to demonstrate retry behavior * Each thread+city combination gets its own counter to simulate
app/agents/tool-retry.ts:29
↓ 1 callers
Function
summarizationAgent
(options: { message: string; apiKey: string; threadId?: string; model?: string; })
app/agents/summarization.ts:263
↓ 1 callers
Function
todoListAgent
(options: { message: string; apiKey: string; model?: string; threadId?: string; })
app/agents/todo-list.ts:80
↓ 1 callers
Function
toolCallLimitsAgent
(options: { message: string; apiKey: string; threadId?: string; })
app/agents/tool-call-limits.ts:40
↓ 1 callers
Function
toolEmulatorAgent
(options: { message: string; apiKey: string; threadId?: string; })
app/agents/tool-emulator.ts:47
↓ 1 callers
Function
toolRetryAgent
(options: { message: string; apiKey: string; threadId?: string; })
app/agents/tool-retry.ts:66
↓ 1 callers
Function
updateEditedArg
(key: string, value: string)
app/components/InterruptBubble.tsx:70
Function
ApiKeyInput
({ apiKey, onApiKeyChange }: ApiKeyInputProps)
app/components/ApiKeyInput.tsx:10
Function
ChatInterface
({ selectedScenario, apiKey }: ChatInterfaceProps)
app/components/ChatInterface.tsx:75
Function
ConversationStatistics
()
app/components/ConversationStatistics.tsx:6
Function
ErrorBubble
({ error }: ErrorBubbleProps)
app/components/ErrorBubble.tsx:7
Function
ExamplePrompt
({ prompt, apiKey, handleSend }: { prompt: string, apiKey: string, handleSend: (prompt: string) => void })
app/components/Welcome.tsx:84
Function
Home
()
app/page.tsx:7
Function
InterruptBubble
({ interruptData, onApprove, onReject, onEdit, }: InterruptBubbleProps)
app/components/InterruptBubble.tsx:13
Function
POST
(request: NextRequest)
app/api/tool-retry/route.ts:4
Function
POST
(request: NextRequest)
app/api/model-call-limits/route.ts:4
Function
POST
(request: NextRequest)
app/api/model-fallback/route.ts:4
Function
POST
(request: NextRequest)
app/api/moderation/route.ts:4
Function
POST
(request: NextRequest)
app/api/tool-call-limits/route.ts:4
Function
POST
(request: NextRequest)
app/api/todo-list/route.ts:4
Function
POST
(request: NextRequest)
app/api/pii-redaction/route.ts:4
Function
POST
(request: NextRequest)
app/api/cloudflare-mcp/route.ts:4
Function
POST
(request: NextRequest)
app/api/basic/route.ts:4
Function
POST
(request: NextRequest)
app/api/context-editing/route.ts:4
Function
POST
(request: NextRequest)
app/api/tool-emulator/route.ts:4
Function
POST
(request: NextRequest)
app/api/summarization/route.ts:4
Function
POST
(request: NextRequest)
app/api/hitl/route.ts:6
Function
RootLayout
({ children, }: Readonly<{ children: React.ReactNode; }>)
app/layout.tsx:22
Function
Sidebar
({ selectedScenario, apiKey, onScenarioSelect, onApiKeyChange }: SidebarProps)
app/components/Sidebar.tsx:35
Function
StatisticsProvider
({ children }: { children: ReactNode })
app/contexts/StatisticsContext.tsx:63
Function
SummarizationBubble
({ summary }: { summary: SummarizationEvent })
app/components/SummarizationBubble.tsx:17
Function
ThemeProvider
({ children, ...props }: ThemeProviderProps)
app/components/ThemeProvider.tsx:11
Function
ThemeSwitcher
()
app/components/ThemeSwitcher.tsx:6
Function
ToolCallBubble
({ toolCallState }: ToolCallBubbleProps)
app/components/ToolCall.tsx:15
Function
WelcomeScreen
({ selectedScenario, apiKey, handleSend }: WelcomeScreenProps)
app/components/Welcome.tsx:55
Function
cancelEditing
()
app/components/InterruptBubble.tsx:65
Method
constructor
(message: string)
app/agents/tool-retry.ts:46
Function
handleApprove
()
app/components/InterruptBubble.tsx:35
Function
handleEdit
()
app/components/InterruptBubble.tsx:51
Function
handleReject
()
app/components/InterruptBubble.tsx:39
Function
handleRejectConfirm
()
app/components/InterruptBubble.tsx:47
Function
handleToggle
(e: React.MouseEvent<HTMLButtonElement>)
app/components/ThemeSwitcher.tsx:46
Function
startEditing
()
app/components/InterruptBubble.tsx:59