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

Function assistant

packages/opencode/test/acp/usage.test.ts:11–26  ·  view source on GitHub ↗
(
  input: Partial<UsageService.AssistantMessage> & Pick<UsageService.AssistantMessage, "cost">,
)

Source from the content-addressed store, hash-verified

9import { it } from "../lib/effect"
10
11const assistant = (
12 input: Partial<UsageService.AssistantMessage> & Pick<UsageService.AssistantMessage, "cost">,
13): UsageService.SessionMessage => ({
14 info: {
15 role: "assistant",
16 providerID: "anthropic",
17 modelID: "claude-sonnet",
18 tokens: {
19 input: 10,
20 output: 20,
21 reasoning: 0,
22 cache: { read: 0, write: 0 },
23 },
24 ...input,
25 },
26})
27
28const user = (): UsageService.SessionMessage => ({
29 info: { role: "user" },

Callers 3

usage.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected