mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-16 16:51:02 +02:00
refactor(ts): remove non-client effect run boundaries
This commit is contained in:
parent
be2370ee7b
commit
174d636178
20 changed files with 126 additions and 106 deletions
|
|
@ -165,7 +165,17 @@ const makeOpenAICompatibleProviderFromClient = (
|
|||
export function makeOpenAICompatibleProvider(
|
||||
config: OpenAICompatibleProcessorConfig,
|
||||
): LlmProvider<TextCompletionRuntimeError> {
|
||||
return Effect.runSync(makeOpenAICompatibleProviderEffect(config));
|
||||
const resolved = {
|
||||
defaultModel: config.model ?? "default",
|
||||
defaultTemperature: config.temperature ?? 0.0,
|
||||
maxOutput: config.maxOutput ?? 4096,
|
||||
apiKey: config.apiKey ?? "sk-no-key-required",
|
||||
baseURL: config.baseUrl ?? "http://localhost:1234/v1",
|
||||
} satisfies ResolvedOpenAICompatibleConfig;
|
||||
return makeOpenAICompatibleProviderFromClient(
|
||||
resolved,
|
||||
new OpenAI({ baseURL: resolved.baseURL, apiKey: resolved.apiKey }),
|
||||
);
|
||||
}
|
||||
|
||||
export const makeOpenAICompatibleProviderEffect = Effect.fn("makeOpenAICompatibleProvider")(function*(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue