test(opencode): port provider.test.ts to it.instance (#28565)
This commit is contained in:
@@ -7,6 +7,7 @@ import * as Log from "@opencode-ai/core/util/log"
|
|||||||
import { Npm } from "@opencode-ai/core/npm"
|
import { Npm } from "@opencode-ai/core/npm"
|
||||||
import { Hash } from "@opencode-ai/core/util/hash"
|
import { Hash } from "@opencode-ai/core/util/hash"
|
||||||
import { Plugin } from "../plugin"
|
import { Plugin } from "../plugin"
|
||||||
|
import { serviceUse } from "@/effect/service-use"
|
||||||
import { type LanguageModelV3 } from "@ai-sdk/provider"
|
import { type LanguageModelV3 } from "@ai-sdk/provider"
|
||||||
import * as ModelsDev from "@opencode-ai/core/models-dev"
|
import * as ModelsDev from "@opencode-ai/core/models-dev"
|
||||||
import { Auth } from "../auth"
|
import { Auth } from "../auth"
|
||||||
@@ -1010,6 +1011,8 @@ interface State {
|
|||||||
|
|
||||||
export class Service extends Context.Service<Service, Interface>()("@opencode/Provider") {}
|
export class Service extends Context.Service<Service, Interface>()("@opencode/Provider") {}
|
||||||
|
|
||||||
|
export const use = serviceUse(Service)
|
||||||
|
|
||||||
function cost(c: ModelsDev.Model["cost"]): Model["cost"] {
|
function cost(c: ModelsDev.Model["cost"]): Model["cost"] {
|
||||||
const result: Model["cost"] = {
|
const result: Model["cost"] = {
|
||||||
input: c?.input ?? 0,
|
input: c?.input ?? 0,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user