Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

fileReferenceFor.md

35 lines710 Bytes

1---
2id: fileReferenceFor
3title: fileReferenceFor
4---
5​
6```ts
7function fileReferenceFor(source, providerName): string;
8```
9​
10Defined in: packages/ai/src/utilities/content-source.ts:27
11​
12Resolve the handle `providerName` should send for a file source.
13​
14A file source carries one opaque handle (`value`) and, optionally, the
15provider that issued it. An adapter always knows which provider it talks
16to, so a source that names no provider is taken as-is.
17​
18## Parameters
19​
20### source
21​
22[`ContentPartFileSource`](../interfaces/ContentPartFileSource.md)
23​
24### providerName
25​
26`string`
27​
28## Returns
29​
30`string`
31​
32## Throws
33​
34when the source names a different issuing provider. A handle only
35resolves at the provider that minted it.