MCPcopy Index your code
hub / github.com/anomalyco/opencode / createMockModel

Function createMockModel

packages/opencode/test/provider/transform.test.ts:2942–2974  ·  view source on GitHub ↗
(overrides: Partial<any> = {})

Source from the content-addressed store, hash-verified

2940
2941describe("ProviderTransform.variants", () => {
2942 const createMockModel = (overrides: Partial<any> = {}): any => ({
2943 id: "test/test-model",
2944 providerID: "test",
2945 api: {
2946 id: "test-model",
2947 url: "https://api.test.com",
2948 npm: "@ai-sdk/openai",
2949 },
2950 name: "Test Model",
2951 capabilities: {
2952 temperature: true,
2953 reasoning: true,
2954 attachment: true,
2955 toolcall: true,
2956 input: { text: true, audio: false, image: true, video: false, pdf: false },
2957 output: { text: true, audio: false, image: false, video: false, pdf: false },
2958 interleaved: false,
2959 },
2960 cost: {
2961 input: 0.001,
2962 output: 0.002,
2963 cache: { read: 0.0001, write: 0.0002 },
2964 },
2965 limit: {
2966 context: 200_000,
2967 output: 64_000,
2968 },
2969 status: "active",
2970 options: {},
2971 headers: {},
2972 release_date: "2024-01-01",
2973 ...overrides,
2974 })
2975
2976 test("returns empty object when model has no reasoning capabilities", () => {
2977 const model = createMockModel({

Callers 3

transform.test.tsFile · 0.85
sapModelFunction · 0.85
cfModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected