Skip to content

Commit 9866ab5

Browse files
waleedlatif1claude
andcommitted
docs(fireworks): restore TSDoc on utils helpers
Restore the TSDoc blocks on supportsNativeStructuredOutputs, createReadableStreamFromOpenAIStream, and checkForForcedToolUsage — TSDoc is the codebase documentation standard and should not have been stripped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 683c105 commit 9866ab5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

apps/sim/providers/fireworks/utils.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,29 @@ import type { ChatCompletionChunk } from 'openai/resources/chat/completions'
22
import type { CompletionUsage } from 'openai/resources/completions'
33
import { checkForForcedToolUsageOpenAI, createOpenAICompatibleStream } from '@/providers/utils'
44

5-
/** Fireworks supports native json_schema structured outputs for all models on its inference API. */
5+
/**
6+
* Checks if a model supports native structured outputs (json_schema).
7+
* Fireworks AI supports structured outputs across their inference API.
8+
*/
69
export async function supportsNativeStructuredOutputs(_modelId: string): Promise<boolean> {
710
return true
811
}
912

13+
/**
14+
* Creates a ReadableStream from a Fireworks streaming response.
15+
* Uses the shared OpenAI-compatible streaming utility.
16+
*/
1017
export function createReadableStreamFromOpenAIStream(
1118
openaiStream: AsyncIterable<ChatCompletionChunk>,
1219
onComplete?: (content: string, usage: CompletionUsage) => void
1320
): ReadableStream<Uint8Array> {
1421
return createOpenAICompatibleStream(openaiStream, 'Fireworks', onComplete)
1522
}
1623

24+
/**
25+
* Checks if a forced tool was used in a Fireworks response.
26+
* Uses the shared OpenAI-compatible forced tool usage helper.
27+
*/
1728
export function checkForForcedToolUsage(
1829
response: any,
1930
toolChoice: string | { type: string; function?: { name: string }; name?: string; any?: any },

0 commit comments

Comments
 (0)