Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

settings.ts

34 lines1.1 KB

1/**
2 * Shared by the server driver and the client settings form, so it holds only browser-safe schema
3 * code.
4 */
5import {
6 CustomModelSetting,
7 makeBinaryPathSetting,
8 makeProviderSettingsSchema,
9} from "@t3tools/contracts";
10import * as Effect from "effect/Effect";
11import * as Schema from "effect/Schema";
12​
13export const MuseSettings = makeProviderSettingsSchema(
14 {
15 enabled: Schema.Boolean.pipe(
16 Schema.withDecodingDefault(Effect.succeed(false)),
17 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
18 ),
19 binaryPath: makeBinaryPathSetting("muse").pipe(
20 Schema.annotateKey({
21 title: "Binary path",
22 description:
23 "Path to the Muse Code binary on this environment. Sign in with muse login on that host.",
24 providerSettingsForm: { placeholder: "muse", clearWhenEmpty: "omit" },
25 }),
26 ),
27 customModels: Schema.Array(CustomModelSetting).pipe(
28 Schema.withDecodingDefault(Effect.succeed([])),
29 Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
30 ),
31 },
32 { order: ["binaryPath"] },
33);
34export type MuseSettings = typeof MuseSettings.Type;