Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
在 Effect TypeScript 应用中使用 Phaseo。
npm install effect @effect/platform
import { FetchHttpClient, HttpClient, HttpClientRequest } from "@effect/platform"; import { Config, Effect, Redacted } from "effect"; const generate = Effect.gen(function* () { const apiKey = yield* Config.redacted("PHASEO_API_KEY"); const client = yield* HttpClient.HttpClient; const request = HttpClientRequest.post( "https://api.phaseo.app/v1/chat/completions", ).pipe( HttpClientRequest.bearerToken(Redacted.value(apiKey)), HttpClientRequest.jsonBody({ model: "openai/gpt-6-astra", messages: [{ role: "user", content: "Reply with only: ok" }], }), ); return yield* client.execute(request).pipe( Effect.flatMap((response) => response.json), ); }); const runnable = generate.pipe(Effect.provide(FetchHttpClient.layer));
ok
import OpenAI from "openai"; import { Config, Effect } from "effect"; const makeClient = Effect.gen(function* () { const apiKey = yield* Config.string("PHASEO_API_KEY"); return new OpenAI({ apiKey, baseURL: "https://api.phaseo.app/v1", }); });
openai/gpt-6-astra
此页面对您有帮助吗?