add lib tests

This commit is contained in:
geoffsee
2025-06-01 08:09:03 -04:00
committed by Geoff Seemueller
parent 7019aa30bc
commit 108e5fbd47
13 changed files with 924 additions and 155 deletions

View File

@@ -34,14 +34,13 @@ export class FireworksAiChatProvider extends BaseChatProvider {
}
async processChunk(chunk: any, dataCallback: (data: any) => void): Promise<boolean> {
// Check if this is the final chunk
if (chunk.choices && chunk.choices[0]?.finish_reason === "stop") {
dataCallback({ type: "chat", data: chunk });
return true; // Break the stream
return true;
}
dataCallback({ type: "chat", data: chunk });
return false; // Continue the stream
return false;
}
}
@@ -52,13 +51,7 @@ export class FireworksAiChatSdk {
param: {
openai: OpenAI;
systemPrompt: any;
preprocessedContext: ModelSnapshotType2<
ModelPropertiesDeclarationToProperties<{
role: ISimpleType<UnionStringArray<string[]>>;
content: ISimpleType<unknown>;
}>,
_NotCustomized
>;
preprocessedContext: any;
maxTokens: number;
messages: any;
model: any;