MCPcopy
hub / github.com/continuedev/continue / testFim

Function testFim

packages/openai-adapters/src/test/util.ts:53–75  ·  view source on GitHub ↗
(api: BaseLlmApi, model: string)

Source from the content-addressed store, hash-verified

51}
52
53export function testFim(api: BaseLlmApi, model: string) {
54 test("should successfully fim", async () => {
55 const response = api.fimStream(
56 {
57 model: model,
58 prompt: "This is a ",
59 suffix: " .",
60 stream: true,
61 },
62 new AbortController().signal,
63 );
64
65 let completion = "";
66 for await (const result of response) {
67 expect(result.choices.length).toBeGreaterThan(0);
68 expect(typeof result.choices[0].delta.content).toBe("string");
69
70 completion += result.choices[0].delta.content;
71 }
72
73 expect(completion.length).toBeGreaterThan(0);
74 });
75}
76
77export function testChat(
78 api: BaseLlmApi,

Callers 1

testConfigFunction · 0.85

Calls 1

fimStreamMethod · 0.65

Tested by 1

testConfigFunction · 0.68