MCPcopy Create free account
hub / github.com/TanStack/ai / createOpenRouterSummarize

Function createOpenRouterSummarize

packages/ai-openrouter/src/adapters/summarize.ts:35–48  ·  view source on GitHub ↗
(
  model: TModel,
  apiKey: string,
  config?: Omit<SDKOptions, 'apiKey'>,
)

Source from the content-addressed store, hash-verified

33 * ```
34 */
35export function createOpenRouterSummarize<TModel extends OpenRouterTextModels>(
36 model: TModel,
37 apiKey: string,
38 config?: Omit<SDKOptions, 'apiKey'>,
39): ChatStreamSummarizeAdapter<
40 TModel,
41 InferTextProviderOptions<OpenRouterTextAdapter<TModel>>
42> {
43 return new ChatStreamSummarizeAdapter(
44 new OpenRouterTextAdapter({ apiKey, ...config }, model),
45 model,
46 'openrouter',
47 )
48}
49
50/**
51 * Creates an OpenRouter summarize adapter with automatic API key detection from environment variables.

Callers 2

createSummarizeAdapterFunction · 0.90
openRouterSummarizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected