Effect CommunityEC
Effect Community8mo ago
1 reply
killjoy

AI ToolKit not working

I'm having some trouble getting the AI ToolKit to work properly. I wanted to see if maybe there's something with my application structure that is causing the issue so I'm just trying to get the example from the documentation working, but even that is throwing some type errors for me.

Does this need to be updated?

On line 77:
No overload matches this call. The last overload gave the following error. Argument of type 'AiModel<AiLanguageModel | Tokenizer, OpenAiClient>' is not assignable to parameter of type 'ManagedRuntime<unknown, unknown>'. Type 'AiModel<AiLanguageModel | Tokenizer, OpenAiClient>' is missing the following properties from type 'ManagedRuntime<unknown, unknown>': memoMap, runtimeEffect, runtime, runFork, and 8 more.ts(2769)

On line 86:
Argument of type '<A, E>(effect: Effect<A, E, never>, options?: { readonly signal?: AbortSignal | undefined; } | undefined) => Promise<A>' is not assignable to parameter of type '(_: Effect<void, AiError | ConfigError, AiLanguageModel>) => Promise<void>'. Types of parameters 'effect' and '_' are incompatible. Type 'Effect<void, AiError | ConfigError, AiLanguageModel>' is not assignable to type 'Effect<void, AiError | ConfigError, never>'. Type 'AiLanguageModel' is not assignable to type 'never'.ts(2345)
image.png
Was this page helpful?