Skip to content

Commit 3a13732

Browse files
committed
remove StreamChunk from ai-sdk.ts
1 parent 894b548 commit 3a13732

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

backend/src/llm-apis/vercel-ai-sdk/ai-sdk.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ import type {
3131
import type { LanguageModel } from 'ai'
3232
import type { z } from 'zod/v4'
3333

34-
export type StreamChunk =
35-
| {
36-
type: 'text'
37-
text: string
38-
}
39-
| {
40-
type: 'reasoning'
41-
text: string
42-
}
43-
| { type: 'error'; message: string }
44-
4534
// TODO: We'll want to add all our models here!
4635
const modelToAiSDKModel = (model: Model): LanguageModel => {
4736
if (

backend/src/tools/stream-parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ import { executeCustomToolCall, executeToolCall } from './tool-executor'
1616

1717
import type { BatchStrReplaceState } from './batch-str-replace'
1818
import type { CustomToolCall, ExecuteToolCallParams } from './tool-executor'
19-
import type { StreamChunk } from '../llm-apis/vercel-ai-sdk/ai-sdk'
2019
import type { AgentTemplate } from '../templates/types'
2120
import type { ToolName } from '@codebuff/common/tools/constants'
2221
import type { CodebuffToolCall } from '@codebuff/common/tools/list'
22+
import type { StreamChunk } from '@codebuff/common/types/contracts/llm'
23+
import type { Logger } from '@codebuff/common/types/contracts/logger'
24+
import type { ParamsExcluding } from '@codebuff/common/types/function-params'
2325
import type {
2426
Message,
2527
ToolMessage,
@@ -28,8 +30,6 @@ import type { ToolResultPart } from '@codebuff/common/types/messages/content-par
2830
import type { PrintModeEvent } from '@codebuff/common/types/print-mode'
2931
import type { AgentState, Subgoal } from '@codebuff/common/types/session-state'
3032
import type { ProjectFileContext } from '@codebuff/common/util/file'
31-
import type { ParamsExcluding } from '@codebuff/common/types/function-params'
32-
import type { Logger } from '@codebuff/common/types/contracts/logger'
3333
import type { ToolCallPart } from 'ai'
3434
import type { WebSocket } from 'ws'
3535

backend/src/xml-stream-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
toolNameParam,
88
} from '@codebuff/common/tools/constants'
99

10-
import type { StreamChunk } from './llm-apis/vercel-ai-sdk/ai-sdk'
1110
import type { Model } from '@codebuff/common/old-constants'
11+
import type { StreamChunk } from '@codebuff/common/types/contracts/llm'
12+
import type { Logger } from '@codebuff/common/types/contracts/logger'
1213
import type {
1314
PrintModeError,
1415
PrintModeText,
1516
PrintModeToolCall,
1617
} from '@codebuff/common/types/print-mode'
17-
import type { Logger } from '@codebuff/common/types/contracts/logger'
1818

1919
const toolExtractionPattern = new RegExp(
2020
`${startToolTag}(.*?)${endToolTag}`,

0 commit comments

Comments
 (0)