0.1.17 #18
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}))
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user