0.1.17 #18
@@ -53,11 +53,11 @@ export const OpenAIClientLive = (
|
|||||||
|
|
||||||
new openai.OpenAI({
|
new openai.OpenAI({
|
||||||
apiKey: yield* config.apiKey,
|
apiKey: yield* config.apiKey,
|
||||||
organization: (yield* config.organization || Config.succeed(undefined)) || null,
|
organization: (yield* config.organization ?? Config.succeed(undefined)) ?? null,
|
||||||
project: (yield* config.project || Config.succeed(undefined)) || null,
|
project: (yield* config.project ?? Config.succeed(undefined)) ?? null,
|
||||||
baseURL: (yield* config.baseURL || Config.succeed(undefined)) || "https://api.openai.com/v1",
|
baseURL: (yield* config.baseURL ?? Config.succeed(undefined)) ?? "https://api.openai.com/v1",
|
||||||
timeout: yield* config.timeout || Config.succeed(undefined),
|
timeout: yield* config.timeout ?? Config.succeed(undefined),
|
||||||
maxRetries: yield* config.maxRetries || Config.succeed(undefined),
|
maxRetries: yield* config.maxRetries ?? Config.succeed(undefined),
|
||||||
|
|
||||||
httpAgent: config.httpAgent,
|
httpAgent: config.httpAgent,
|
||||||
fetch: config.fetch,
|
fetch: config.fetch,
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ const importExpress = Effect.tryPromise({
|
|||||||
|
|
||||||
export const ExpressAppLive = (
|
export const ExpressAppLive = (
|
||||||
config: {
|
config: {
|
||||||
readonly trustProxy?: Config.Config<boolean>
|
readonly trustProxy?: Config.Config<boolean | undefined>
|
||||||
} = {}
|
} = {}
|
||||||
) => Layer.effect(ExpressApp, Effect.gen(function*() {
|
) => Layer.effect(ExpressApp, Effect.gen(function*() {
|
||||||
const app = (yield* importExpress).default()
|
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
|
return app
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -36,15 +36,15 @@ export const ExpressNodeHTTPServerLive = (
|
|||||||
const http = yield* importNodeHTTP
|
const http = yield* importNodeHTTP
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
backlog: yield* config.backlog || Config.succeed(undefined),
|
backlog: yield* config.backlog ?? Config.succeed(undefined),
|
||||||
exclusive: yield* config.exclusive || Config.succeed(undefined),
|
exclusive: yield* config.exclusive ?? Config.succeed(undefined),
|
||||||
host: yield* config.host || Config.succeed(undefined),
|
host: yield* config.host ?? Config.succeed(undefined),
|
||||||
ipv6Only: yield* config.ipv6Only || Config.succeed(undefined),
|
ipv6Only: yield* config.ipv6Only ?? Config.succeed(undefined),
|
||||||
path: yield* config.path || Config.succeed(undefined),
|
path: yield* config.path ?? Config.succeed(undefined),
|
||||||
port: yield* config.port || Config.succeed(undefined),
|
port: yield* config.port ?? Config.succeed(undefined),
|
||||||
readableAll: yield* config.readableAll || Config.succeed(undefined),
|
readableAll: yield* config.readableAll ?? Config.succeed(undefined),
|
||||||
signal: config.signal,
|
signal: config.signal,
|
||||||
writableAll: yield* config.writableAll || Config.succeed(undefined),
|
writableAll: yield* config.writableAll ?? Config.succeed(undefined),
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
return yield* Effect.async<Server>(resume => {
|
return yield* Effect.async<Server>(resume => {
|
||||||
|
|||||||
Reference in New Issue
Block a user