MCPcopy Create free account
hub / github.com/Effect-TS/effect / model

Function model

packages/ai/openai/src/OpenAiEmbeddingModel.ts:91–106  ·  view source on GitHub ↗
(
  model: (string & {}) | Model,
  { mode, ...config }: Simplify<
    (
      | ({ readonly mode: "batched" } & Config.Batched)
      | ({ readonly mode: "data-loader" } & Config.DataLoader)
    )
  >
)

Source from the content-addressed store, hash-verified

89 * @category Models
90 */
91export const model = (
92 model: (string & {}) | Model,
93 { mode, ...config }: Simplify<
94 (
95 | ({ readonly mode: "batched" } & Config.Batched)
96 | ({ readonly mode: "data-loader" } & Config.DataLoader)
97 )
98 >
99): AiModel.Model<"openai", EmbeddingModel.EmbeddingModel, OpenAiClient.OpenAiClient> => {
100 return AiModel.make(
101 "openai",
102 mode === "batched"
103 ? layerBatched({ model, config: config as Config.Batched })
104 : layerDataLoader({ model, config: config as Config.DataLoader })
105 )
106}
107
108/**
109 * @since 1.0.0

Callers

nothing calls this directly

Calls 3

layerBatchedFunction · 0.85
layerDataLoaderFunction · 0.85
makeMethod · 0.65

Tested by

no test coverage detected