0.1.17 #18

Merged
Thilawyn merged 37 commits from next into master 2024-09-07 20:56:30 +02:00
3 changed files with 15 additions and 15 deletions
Showing only changes of commit ca10286e1f - Show all commits

View File

@@ -53,11 +53,11 @@ export const OpenAIClientLive = (
new openai.OpenAI({
apiKey: yield* config.apiKey,
organization: (yield* config.organization || Config.succeed(undefined)) || null,
project: (yield* config.project || Config.succeed(undefined)) || null,
baseURL: (yield* config.baseURL || Config.succeed(undefined)) || "https://api.openai.com/v1",
timeout: yield* config.timeout || Config.succeed(undefined),
maxRetries: yield* config.maxRetries || Config.succeed(undefined),
organization: (yield* config.organization ?? Config.succeed(undefined)) ?? null,
project: (yield* config.project ?? Config.succeed(undefined)) ?? null,
baseURL: (yield* config.baseURL ?? Config.succeed(undefined)) ?? "https://api.openai.com/v1",
timeout: yield* config.timeout ?? Config.succeed(undefined),
maxRetries: yield* config.maxRetries ?? Config.succeed(undefined),
httpAgent: config.httpAgent,
fetch: config.fetch,

View File

@@ -12,10 +12,10 @@ const importExpress = Effect.tryPromise({
export const ExpressAppLive = (
config: {
readonly trustProxy?: Config.Config<boolean>
readonly trustProxy?: Config.Config<boolean | undefined>
} = {}
) => Layer.effect(ExpressApp, Effect.gen(function*() {
const app = (yield* importExpress).default()
app.set("trust proxy", yield* config.trustProxy || Config.succeed(false))
app.set("trust proxy", (yield* config.trustProxy ?? Config.succeed(undefined)) ?? false)
return app
}))

View File

@@ -36,15 +36,15 @@ export const ExpressNodeHTTPServerLive = (
const http = yield* importNodeHTTP
const options = {
backlog: yield* config.backlog || Config.succeed(undefined),
exclusive: yield* config.exclusive || Config.succeed(undefined),
host: yield* config.host || Config.succeed(undefined),
ipv6Only: yield* config.ipv6Only || Config.succeed(undefined),
path: yield* config.path || Config.succeed(undefined),
port: yield* config.port || Config.succeed(undefined),
readableAll: yield* config.readableAll || Config.succeed(undefined),
backlog: yield* config.backlog ?? Config.succeed(undefined),
exclusive: yield* config.exclusive ?? Config.succeed(undefined),
host: yield* config.host ?? Config.succeed(undefined),
ipv6Only: yield* config.ipv6Only ?? Config.succeed(undefined),
path: yield* config.path ?? Config.succeed(undefined),
port: yield* config.port ?? Config.succeed(undefined),
readableAll: yield* config.readableAll ?? Config.succeed(undefined),
signal: config.signal,
writableAll: yield* config.writableAll || Config.succeed(undefined),
writableAll: yield* config.writableAll ?? Config.succeed(undefined),
} as const
return yield* Effect.async<Server>(resume => {