mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-05 11:22:11 +02:00
Use Match for Effect AI stream parts
This commit is contained in:
parent
3a256096f8
commit
664aef44a7
3 changed files with 33 additions and 18 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { describe, expect, it } from "@effect/vitest";
|
||||
import type { LlmChunk } from "@trustgraph/base";
|
||||
import { Effect, Layer, ManagedRuntime, Stream } from "effect";
|
||||
import { AiError, LanguageModel } from "effect/unstable/ai";
|
||||
import { AiError, LanguageModel, Response } from "effect/unstable/ai";
|
||||
import {
|
||||
llmStreamPart,
|
||||
makeLanguageModelProvider,
|
||||
|
|
@ -157,6 +157,7 @@ describe("text completion common helpers", () => {
|
|||
]),
|
||||
streamText: () =>
|
||||
Stream.fromArray([
|
||||
Response.makePart("text-start", { id: "part-1" }),
|
||||
{ type: "text-delta", id: "part-1", delta: "hel" },
|
||||
{ type: "text-delta", id: "part-1", delta: "lo" },
|
||||
finishPart(13, 8),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue