MCPcopy Create free account
hub / github.com/anomalyco/opencode / validateChat

Function validateChat

packages/llm/script/setup-recording-env.ts:378–394  ·  view source on GitHub ↗
(input: {
  readonly url: string
  readonly token: Redacted.Redacted<string>
  readonly tokenHeader?: string
  readonly model: string
  readonly headers?: Record<string, string>
})

Source from the content-addressed store, hash-verified

376 )
377
378const validateChat = (input: {
379 readonly url: string
380 readonly token: Redacted.Redacted<string>
381 readonly tokenHeader?: string
382 readonly model: string
383 readonly headers?: Record<string, string>
384}) =>
385 ProviderShared.jsonPost({
386 url: input.url,
387 headers: { ...input.headers, [input.tokenHeader ?? "authorization"]: `Bearer ${Redacted.value(input.token)}` },
388 body: ProviderShared.encodeJson({
389 model: input.model,
390 messages: [{ role: "user", content: "Reply with exactly: ok" }],
391 max_tokens: 3,
392 temperature: 0,
393 }),
394 }).pipe(executeRequest)
395
396const validateBedrock = (env: Env) =>
397 Effect.gen(function* () {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected