@launchdarkly/server-sdk-ai 0.9.9 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/__tests__/LDAIClientImpl.test.ts +3 -0
- package/__tests__/LDAIConfigMapper.test.ts +159 -0
- package/__tests__/LDAIConfigTrackerImpl.test.ts +445 -0
- package/__tests__/TokenUsage.test.ts +43 -2
- package/dist/LDAIClientImpl.d.ts.map +1 -1
- package/dist/LDAIClientImpl.js +3 -1
- package/dist/LDAIClientImpl.js.map +1 -1
- package/dist/LDAIConfigMapper.d.ts +10 -0
- package/dist/LDAIConfigMapper.d.ts.map +1 -0
- package/dist/LDAIConfigMapper.js +54 -0
- package/dist/LDAIConfigMapper.js.map +1 -0
- package/dist/LDAIConfigTrackerImpl.d.ts +15 -0
- package/dist/LDAIConfigTrackerImpl.d.ts.map +1 -1
- package/dist/LDAIConfigTrackerImpl.js +51 -2
- package/dist/LDAIConfigTrackerImpl.js.map +1 -1
- package/dist/api/config/LDAIConfig.d.ts +16 -3
- package/dist/api/config/LDAIConfig.d.ts.map +1 -1
- package/dist/api/config/LDAIConfigTracker.d.ts +39 -0
- package/dist/api/config/LDAIConfigTracker.d.ts.map +1 -1
- package/dist/api/config/VercelAISDK.d.ts +18 -0
- package/dist/api/config/VercelAISDK.d.ts.map +1 -0
- package/dist/api/config/VercelAISDK.js +3 -0
- package/dist/api/config/VercelAISDK.js.map +1 -0
- package/dist/api/config/index.d.ts +1 -0
- package/dist/api/config/index.d.ts.map +1 -1
- package/dist/api/config/index.js +1 -0
- package/dist/api/config/index.js.map +1 -1
- package/dist/api/metrics/VercelAISDKTokenUsage.d.ts +7 -0
- package/dist/api/metrics/VercelAISDKTokenUsage.d.ts.map +1 -0
- package/dist/api/metrics/VercelAISDKTokenUsage.js +13 -0
- package/dist/api/metrics/VercelAISDKTokenUsage.js.map +1 -0
- package/dist/api/metrics/index.d.ts +2 -0
- package/dist/api/metrics/index.d.ts.map +1 -1
- package/dist/api/metrics/index.js +2 -0
- package/dist/api/metrics/index.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/enums/LDFeedbackKind.html +11 -6
- package/docs/functions/createBedrockTokenUsage.html +9 -4
- package/docs/functions/createOpenAiUsage.html +73 -0
- package/docs/functions/createVercelAISDKTokenUsage.html +73 -0
- package/docs/functions/initAi.html +9 -4
- package/docs/index.html +14 -4
- package/docs/interfaces/LDAIClient.html +10 -5
- package/docs/interfaces/LDAIConfig.html +53 -9
- package/docs/interfaces/LDAIConfigTracker.html +92 -15
- package/docs/interfaces/LDMessage.html +11 -6
- package/docs/interfaces/LDModelConfig.html +12 -7
- package/docs/interfaces/LDProviderConfig.html +11 -6
- package/docs/interfaces/LDTokenUsage.html +12 -7
- package/docs/interfaces/VercelAISDKConfig.html +149 -0
- package/docs/interfaces/VercelAISDKMapOptions.html +81 -0
- package/docs/types/LDAIDefaults.html +11 -6
- package/docs/types/VercelAISDKProvider.html +75 -0
- package/package.json +1 -1
- package/src/LDAIClientImpl.ts +21 -3
- package/src/LDAIConfigMapper.ts +64 -0
- package/src/LDAIConfigTrackerImpl.ts +73 -2
- package/src/api/config/LDAIConfig.ts +20 -3
- package/src/api/config/LDAIConfigTracker.ts +49 -0
- package/src/api/config/VercelAISDK.ts +20 -0
- package/src/api/config/index.ts +1 -0
- package/src/api/metrics/VercelAISDKTokenUsage.ts +13 -0
- package/src/api/metrics/index.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIClient | @launchdarkly/server-sdk-ai - v0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIClient | @launchdarkly/server-sdk-ai - v0.10.0</title><meta name="description" content="Documentation for @launchdarkly/server-sdk-ai"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.10.0</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-content">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ul class="tsd-hierarchy">
|
|
25
25
|
<li><span class="target">LDAIClient</span></li></ul></section><aside class="tsd-sources">
|
|
26
26
|
<ul>
|
|
27
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
27
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/LDAIClient.ts#L8">api/LDAIClient.ts:8</a></li></ul></aside>
|
|
28
28
|
<section class="tsd-panel-group tsd-index-group">
|
|
29
29
|
<section class="tsd-panel tsd-index-panel">
|
|
30
30
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -77,7 +77,7 @@ be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
|
77
77
|
</code><button>Copy</button></pre>
|
|
78
78
|
</div><aside class="tsd-sources">
|
|
79
79
|
<ul>
|
|
80
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
80
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/LDAIClient.ts#L60">api/LDAIClient.ts:60</a></li></ul></aside></li></ul></section></section></div>
|
|
81
81
|
<div class="col-sidebar">
|
|
82
82
|
<div class="page-menu">
|
|
83
83
|
<div class="tsd-navigation settings">
|
|
@@ -99,7 +99,7 @@ be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
|
99
99
|
<ul>
|
|
100
100
|
<li><a href="#config" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>config</span></a></li></ul></div></details></div>
|
|
101
101
|
<div class="site-menu">
|
|
102
|
-
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.
|
|
102
|
+
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.10.0</span></a>
|
|
103
103
|
<ul class="tsd-small-nested-navigation">
|
|
104
104
|
<li><a href="../enums/LDFeedbackKind.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>LDFeedback<wbr/>Kind</span></a></li>
|
|
105
105
|
<li><a href="LDAIClient.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>LDAIClient</span></a></li>
|
|
@@ -109,8 +109,13 @@ be used to track AI operation metrics (latency, token usage, etc.).</p>
|
|
|
109
109
|
<li><a href="LDModelConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDModel<wbr/>Config</span></a></li>
|
|
110
110
|
<li><a href="LDProviderConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDProvider<wbr/>Config</span></a></li>
|
|
111
111
|
<li><a href="LDTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDToken<wbr/>Usage</span></a></li>
|
|
112
|
+
<li><a href="VercelAISDKConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKConfig</span></a></li>
|
|
113
|
+
<li><a href="VercelAISDKMapOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKMap<wbr/>Options</span></a></li>
|
|
112
114
|
<li><a href="../types/LDAIDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>LDAIDefaults</span></a></li>
|
|
115
|
+
<li><a href="../types/VercelAISDKProvider.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>VercelAISDKProvider</span></a></li>
|
|
113
116
|
<li><a href="../functions/createBedrockTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>create<wbr/>Bedrock<wbr/>Token<wbr/>Usage</span></a></li>
|
|
117
|
+
<li><a href="../functions/createOpenAiUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>Open<wbr/>Ai<wbr/>Usage</span></a></li>
|
|
118
|
+
<li><a href="../functions/createVercelAISDKTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>VercelAISDKToken<wbr/>Usage</span></a></li>
|
|
114
119
|
<li><a href="../functions/initAi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Ai</span></a></li></ul></nav></div></div></div>
|
|
115
120
|
<div class="tsd-generator">
|
|
116
121
|
<p>Generated using <a href="https://typedoc.org/" rel="noopener" target="_blank">TypeDoc</a></p></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIConfig | @launchdarkly/server-sdk-ai - v0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIConfig | @launchdarkly/server-sdk-ai - v0.10.0</title><meta name="description" content="Documentation for @launchdarkly/server-sdk-ai"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.10.0</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-content">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ul class="tsd-hierarchy">
|
|
25
25
|
<li><span class="target">LDAIConfig</span></li></ul></section><aside class="tsd-sources">
|
|
26
26
|
<ul>
|
|
27
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
27
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L48">api/config/LDAIConfig.ts:48</a></li></ul></aside>
|
|
28
28
|
<section class="tsd-panel-group tsd-index-group">
|
|
29
29
|
<section class="tsd-panel tsd-index-panel">
|
|
30
30
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
<a href="LDAIConfig.html#messages" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>messages?</span></a>
|
|
37
37
|
<a href="LDAIConfig.html#model" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>model?</span></a>
|
|
38
38
|
<a href="LDAIConfig.html#provider" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>provider?</span></a>
|
|
39
|
+
<a href="LDAIConfig.html#toVercelAISDK" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>to<wbr/>VercelAISDK</span></a>
|
|
39
40
|
<a href="LDAIConfig.html#tracker" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>tracker</span></a>
|
|
40
41
|
</div></section></div></details></section></section>
|
|
41
42
|
<section class="tsd-panel-group tsd-member-group">
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
</div>
|
|
48
49
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
49
50
|
<ul>
|
|
50
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
51
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L71">api/config/LDAIConfig.ts:71</a></li></ul></aside></section>
|
|
51
52
|
<section class="tsd-panel tsd-member"><a id="messages" class="tsd-anchor"></a>
|
|
52
53
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>messages</span><a href="#messages" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
53
54
|
<div class="tsd-signature"><span class="tsd-kind-property">messages</span><span class="tsd-signature-symbol">?:</span> <a href="LDMessage.html" class="tsd-signature-type tsd-kind-interface">LDMessage</a><span class="tsd-signature-symbol">[]</span></div>
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
</div>
|
|
56
57
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
57
58
|
<ul>
|
|
58
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
59
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L56">api/config/LDAIConfig.ts:56</a></li></ul></aside></section>
|
|
59
60
|
<section class="tsd-panel tsd-member"><a id="model" class="tsd-anchor"></a>
|
|
60
61
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>model</span><a href="#model" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
61
62
|
<div class="tsd-signature"><span class="tsd-kind-property">model</span><span class="tsd-signature-symbol">?:</span> <a href="LDModelConfig.html" class="tsd-signature-type tsd-kind-interface">LDModelConfig</a></div>
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
</div>
|
|
64
65
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
65
66
|
<ul>
|
|
66
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
67
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L52">api/config/LDAIConfig.ts:52</a></li></ul></aside></section>
|
|
67
68
|
<section class="tsd-panel tsd-member"><a id="provider" class="tsd-anchor"></a>
|
|
68
69
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagOptional">Optional</code> <span>provider</span><a href="#provider" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
69
70
|
<div class="tsd-signature"><span class="tsd-kind-property">provider</span><span class="tsd-signature-symbol">?:</span> <a href="LDProviderConfig.html" class="tsd-signature-type tsd-kind-interface">LDProviderConfig</a></div>
|
|
@@ -71,7 +72,44 @@
|
|
|
71
72
|
</div>
|
|
72
73
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
73
74
|
<ul>
|
|
74
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
75
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L61">api/config/LDAIConfig.ts:61</a></li></ul></aside></section>
|
|
76
|
+
<section class="tsd-panel tsd-member"><a id="toVercelAISDK" class="tsd-anchor"></a>
|
|
77
|
+
<h3 class="tsd-anchor-link"><span>to<wbr/>VercelAISDK</span><a href="#toVercelAISDK" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
78
|
+
<div class="tsd-signature"><span class="tsd-kind-property">to<wbr/>VercelAISDK</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">provider</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><a href="VercelAISDKConfig.html" class="tsd-signature-type tsd-kind-interface">VercelAISDKConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div>
|
|
79
|
+
<div class="tsd-type-declaration">
|
|
80
|
+
<h4>Type declaration</h4>
|
|
81
|
+
<ul class="tsd-parameters">
|
|
82
|
+
<li class="tsd-parameter-signature">
|
|
83
|
+
<ul class="tsd-signatures">
|
|
84
|
+
<li class="tsd-signature" id="toVercelAISDK.__type.__type-1"><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">provider</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="VercelAISDKConfig.html" class="tsd-signature-type tsd-kind-interface">VercelAISDKConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span></li>
|
|
85
|
+
<li class="tsd-description">
|
|
86
|
+
<div class="tsd-comment tsd-typography"><p>Maps this AI config to a format usable direcly in Vercel AI SDK generateText()
|
|
87
|
+
and streamText() methods.</p>
|
|
88
|
+
<p>WARNING: this method can throw an exception if a Vercel AI SDK model cannot be determined.</p>
|
|
89
|
+
</div>
|
|
90
|
+
<section class="tsd-panel">
|
|
91
|
+
<h4>Type Parameters</h4>
|
|
92
|
+
<ul class="tsd-type-parameter-list">
|
|
93
|
+
<li>
|
|
94
|
+
<h4><span class="tsd-kind-type-parameter">TMod</span></h4></li></ul></section>
|
|
95
|
+
<div class="tsd-parameters">
|
|
96
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
97
|
+
<ul class="tsd-parameter-list">
|
|
98
|
+
<li>
|
|
99
|
+
<h5><span class="tsd-kind-parameter">provider</span>: <a href="../types/VercelAISDKProvider.html" class="tsd-signature-type tsd-kind-type-alias">VercelAISDKProvider</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../types/VercelAISDKProvider.html" class="tsd-signature-type tsd-kind-type-alias">VercelAISDKProvider</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h5>
|
|
100
|
+
<div class="tsd-comment tsd-typography"><p>A Vercel AI SDK Provider or a map of provider names to Vercel AI SDK Providers.</p>
|
|
101
|
+
</div></li>
|
|
102
|
+
<li>
|
|
103
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <a href="VercelAISDKMapOptions.html" class="tsd-signature-type tsd-kind-interface">VercelAISDKMapOptions</a></h5>
|
|
104
|
+
<div class="tsd-comment tsd-typography"><p>Optional mapping options.</p>
|
|
105
|
+
</div><code class="tsd-tag ts-flagOptional">Optional</code> </li></ul></div>
|
|
106
|
+
<h4 class="tsd-returns-title">Returns <a href="VercelAISDKConfig.html" class="tsd-signature-type tsd-kind-interface">VercelAISDKConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TMod</span><span class="tsd-signature-symbol">></span></h4><p>A configuration directly usable in Vercel AI SDK generateText() and streamText()</p>
|
|
107
|
+
|
|
108
|
+
<div class="tsd-comment tsd-typography">
|
|
109
|
+
<h4>Throws</h4><p>if a Vercel AI SDK model cannot be determined from the given provider parameter.</p>
|
|
110
|
+
</div></li></ul></li></ul></div><aside class="tsd-sources">
|
|
111
|
+
<ul>
|
|
112
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L84">api/config/LDAIConfig.ts:84</a></li></ul></aside></section>
|
|
75
113
|
<section class="tsd-panel tsd-member"><a id="tracker" class="tsd-anchor"></a>
|
|
76
114
|
<h3 class="tsd-anchor-link"><span>tracker</span><a href="#tracker" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
77
115
|
<div class="tsd-signature"><span class="tsd-kind-property">tracker</span><span class="tsd-signature-symbol">:</span> <a href="LDAIConfigTracker.html" class="tsd-signature-type tsd-kind-interface">LDAIConfigTracker</a></div>
|
|
@@ -79,7 +117,7 @@
|
|
|
79
117
|
</div>
|
|
80
118
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
81
119
|
<ul>
|
|
82
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
120
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L66">api/config/LDAIConfig.ts:66</a></li></ul></aside></section></section></div>
|
|
83
121
|
<div class="col-sidebar">
|
|
84
122
|
<div class="page-menu">
|
|
85
123
|
<div class="tsd-navigation settings">
|
|
@@ -103,9 +141,10 @@
|
|
|
103
141
|
<li><a href="#messages" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>messages</span></a></li>
|
|
104
142
|
<li><a href="#model" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>model</span></a></li>
|
|
105
143
|
<li><a href="#provider" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>provider</span></a></li>
|
|
144
|
+
<li><a href="#toVercelAISDK" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>to<wbr/>VercelAISDK</span></a></li>
|
|
106
145
|
<li><a href="#tracker" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>tracker</span></a></li></ul></div></details></div>
|
|
107
146
|
<div class="site-menu">
|
|
108
|
-
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.
|
|
147
|
+
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.10.0</span></a>
|
|
109
148
|
<ul class="tsd-small-nested-navigation">
|
|
110
149
|
<li><a href="../enums/LDFeedbackKind.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>LDFeedback<wbr/>Kind</span></a></li>
|
|
111
150
|
<li><a href="LDAIClient.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>LDAIClient</span></a></li>
|
|
@@ -115,8 +154,13 @@
|
|
|
115
154
|
<li><a href="LDModelConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDModel<wbr/>Config</span></a></li>
|
|
116
155
|
<li><a href="LDProviderConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDProvider<wbr/>Config</span></a></li>
|
|
117
156
|
<li><a href="LDTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDToken<wbr/>Usage</span></a></li>
|
|
157
|
+
<li><a href="VercelAISDKConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKConfig</span></a></li>
|
|
158
|
+
<li><a href="VercelAISDKMapOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKMap<wbr/>Options</span></a></li>
|
|
118
159
|
<li><a href="../types/LDAIDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>LDAIDefaults</span></a></li>
|
|
160
|
+
<li><a href="../types/VercelAISDKProvider.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>VercelAISDKProvider</span></a></li>
|
|
119
161
|
<li><a href="../functions/createBedrockTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>create<wbr/>Bedrock<wbr/>Token<wbr/>Usage</span></a></li>
|
|
162
|
+
<li><a href="../functions/createOpenAiUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>Open<wbr/>Ai<wbr/>Usage</span></a></li>
|
|
163
|
+
<li><a href="../functions/createVercelAISDKTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>VercelAISDKToken<wbr/>Usage</span></a></li>
|
|
120
164
|
<li><a href="../functions/initAi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Ai</span></a></li></ul></nav></div></div></div>
|
|
121
165
|
<div class="tsd-generator">
|
|
122
166
|
<p>Generated using <a href="https://typedoc.org/" rel="noopener" target="_blank">TypeDoc</a></p></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIConfigTracker | @launchdarkly/server-sdk-ai - v0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIConfigTracker | @launchdarkly/server-sdk-ai - v0.10.0</title><meta name="description" content="Documentation for @launchdarkly/server-sdk-ai"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.10.0</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-content">
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ul class="tsd-hierarchy">
|
|
25
25
|
<li><span class="target">LDAIConfigTracker</span></li></ul></section><aside class="tsd-sources">
|
|
26
26
|
<ul>
|
|
27
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
27
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L36">api/config/LDAIConfigTracker.ts:36</a></li></ul></aside>
|
|
28
28
|
<section class="tsd-panel-group tsd-index-group">
|
|
29
29
|
<section class="tsd-panel tsd-index-panel">
|
|
30
30
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
<a href="LDAIConfigTracker.html#trackSuccess" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Success</span></a>
|
|
43
43
|
<a href="LDAIConfigTracker.html#trackTimeToFirstToken" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Time<wbr/>To<wbr/>First<wbr/>Token</span></a>
|
|
44
44
|
<a href="LDAIConfigTracker.html#trackTokens" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Tokens</span></a>
|
|
45
|
+
<a href="LDAIConfigTracker.html#trackVercelAISDKGenerateTextMetrics" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>VercelAISDKGenerate<wbr/>Text<wbr/>Metrics</span></a>
|
|
46
|
+
<a href="LDAIConfigTracker.html#trackVercelAISDKStreamTextMetrics" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>VercelAISDKStream<wbr/>Text<wbr/>Metrics</span></a>
|
|
45
47
|
</div></section></div></details></section></section>
|
|
46
48
|
<section class="tsd-panel-group tsd-member-group">
|
|
47
49
|
<h2>Methods</h2>
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">LDAIMetricSummary</span></h4>
|
|
56
58
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
57
59
|
<ul>
|
|
58
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
60
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L188">api/config/LDAIConfigTracker.ts:188</a></li></ul></aside></li></ul></section>
|
|
59
61
|
<section class="tsd-panel tsd-member"><a id="trackBedrockConverseMetrics" class="tsd-anchor"></a>
|
|
60
62
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Bedrock<wbr/>Converse<wbr/>Metrics</span><a href="#trackBedrockConverseMetrics" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
61
63
|
<ul class="tsd-signatures">
|
|
@@ -80,7 +82,7 @@
|
|
|
80
82
|
|
|
81
83
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
82
84
|
<ul>
|
|
83
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
85
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L122">api/config/LDAIConfigTracker.ts:122</a></li></ul></aside></li></ul></section>
|
|
84
86
|
<section class="tsd-panel tsd-member"><a id="trackDuration" class="tsd-anchor"></a>
|
|
85
87
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Duration</span><a href="#trackDuration" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
86
88
|
<ul class="tsd-signatures">
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
100
102
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
101
103
|
<ul>
|
|
102
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
104
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L44">api/config/LDAIConfigTracker.ts:44</a></li></ul></aside></li></ul></section>
|
|
103
105
|
<section class="tsd-panel tsd-member"><a id="trackDurationOf" class="tsd-anchor"></a>
|
|
104
106
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Duration<wbr/>Of</span><a href="#trackDurationOf" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
105
107
|
<ul class="tsd-signatures">
|
|
@@ -127,7 +129,7 @@ In the case the provided function throws, this function will still record the du
|
|
|
127
129
|
|
|
128
130
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
129
131
|
<ul>
|
|
130
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
132
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L88">api/config/LDAIConfigTracker.ts:88</a></li></ul></aside></li></ul></section>
|
|
131
133
|
<section class="tsd-panel tsd-member"><a id="trackError" class="tsd-anchor"></a>
|
|
132
134
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Error</span><a href="#trackError" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
133
135
|
<ul class="tsd-signatures">
|
|
@@ -138,7 +140,7 @@ In the case the provided function throws, this function will still record the du
|
|
|
138
140
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
139
141
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
140
142
|
<ul>
|
|
141
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
143
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L61">api/config/LDAIConfigTracker.ts:61</a></li></ul></aside></li></ul></section>
|
|
142
144
|
<section class="tsd-panel tsd-member"><a id="trackFeedback" class="tsd-anchor"></a>
|
|
143
145
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Feedback</span><a href="#trackFeedback" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
144
146
|
<ul class="tsd-signatures">
|
|
@@ -159,7 +161,7 @@ In the case the provided function throws, this function will still record the du
|
|
|
159
161
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
160
162
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
161
163
|
<ul>
|
|
162
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
164
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L68">api/config/LDAIConfigTracker.ts:68</a></li></ul></aside></li></ul></section>
|
|
163
165
|
<section class="tsd-panel tsd-member"><a id="trackOpenAIMetrics" class="tsd-anchor"></a>
|
|
164
166
|
<h3 class="tsd-anchor-link"><span>track<wbr/>OpenAIMetrics</span><a href="#trackOpenAIMetrics" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
165
167
|
<ul class="tsd-signatures">
|
|
@@ -193,7 +195,7 @@ A failed operation will not have any token usage data.</p>
|
|
|
193
195
|
|
|
194
196
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
195
197
|
<ul>
|
|
196
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
198
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L102">api/config/LDAIConfigTracker.ts:102</a></li></ul></aside></li></ul></section>
|
|
197
199
|
<section class="tsd-panel tsd-member"><a id="trackSuccess" class="tsd-anchor"></a>
|
|
198
200
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Success</span><a href="#trackSuccess" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
199
201
|
<ul class="tsd-signatures">
|
|
@@ -204,7 +206,7 @@ A failed operation will not have any token usage data.</p>
|
|
|
204
206
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
205
207
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
206
208
|
<ul>
|
|
207
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
209
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L56">api/config/LDAIConfigTracker.ts:56</a></li></ul></aside></li></ul></section>
|
|
208
210
|
<section class="tsd-panel tsd-member"><a id="trackTimeToFirstToken" class="tsd-anchor"></a>
|
|
209
211
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Time<wbr/>To<wbr/>First<wbr/>Token</span><a href="#trackTimeToFirstToken" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
210
212
|
<ul class="tsd-signatures">
|
|
@@ -222,7 +224,7 @@ A failed operation will not have any token usage data.</p>
|
|
|
222
224
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
223
225
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
224
226
|
<ul>
|
|
225
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
227
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L75">api/config/LDAIConfigTracker.ts:75</a></li></ul></aside></li></ul></section>
|
|
226
228
|
<section class="tsd-panel tsd-member"><a id="trackTokens" class="tsd-anchor"></a>
|
|
227
229
|
<h3 class="tsd-anchor-link"><span>track<wbr/>Tokens</span><a href="#trackTokens" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
228
230
|
<ul class="tsd-signatures">
|
|
@@ -240,7 +242,75 @@ A failed operation will not have any token usage data.</p>
|
|
|
240
242
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
241
243
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
242
244
|
<ul>
|
|
243
|
-
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/
|
|
245
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L51">api/config/LDAIConfigTracker.ts:51</a></li></ul></aside></li></ul></section>
|
|
246
|
+
<section class="tsd-panel tsd-member"><a id="trackVercelAISDKGenerateTextMetrics" class="tsd-anchor"></a>
|
|
247
|
+
<h3 class="tsd-anchor-link"><span>track<wbr/>VercelAISDKGenerate<wbr/>Text<wbr/>Metrics</span><a href="#trackVercelAISDKGenerateTextMetrics" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
248
|
+
<ul class="tsd-signatures">
|
|
249
|
+
<li class="tsd-signature tsd-anchor-link" id="trackVercelAISDKGenerateTextMetrics.trackVercelAISDKGenerateTextMetrics-1"><span class="tsd-kind-call-signature">track<wbr/>VercelAISDKGenerate<wbr/>Text<wbr/>Metrics</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">func</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span><a href="#trackVercelAISDKGenerateTextMetrics.trackVercelAISDKGenerateTextMetrics-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
250
|
+
<li class="tsd-description">
|
|
251
|
+
<div class="tsd-comment tsd-typography"><p>Track a Vercel AI SDK generateText operation.</p>
|
|
252
|
+
<p>This function will track the duration of the operation, the token usage, and the success or error status.</p>
|
|
253
|
+
<p>If the provided function throws, then this method will also throw.
|
|
254
|
+
In the case the provided function throws, this function will record the duration and an error.
|
|
255
|
+
A failed operation will not have any token usage data.</p>
|
|
256
|
+
</div>
|
|
257
|
+
<section class="tsd-panel">
|
|
258
|
+
<h4>Type Parameters</h4>
|
|
259
|
+
<ul class="tsd-type-parameter-list">
|
|
260
|
+
<li>
|
|
261
|
+
<h4><span class="tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">usage</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">completionTokens</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">promptTokens</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">totalTokens</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></h4></li></ul></section>
|
|
262
|
+
<div class="tsd-parameters">
|
|
263
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
264
|
+
<ul class="tsd-parameter-list">
|
|
265
|
+
<li>
|
|
266
|
+
<h5><span class="tsd-kind-parameter">func</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></h5>
|
|
267
|
+
<div class="tsd-comment tsd-typography"><p>Function which executes the operation.</p>
|
|
268
|
+
</div>
|
|
269
|
+
<ul class="tsd-parameters">
|
|
270
|
+
<li class="tsd-parameter-signature">
|
|
271
|
+
<ul class="tsd-signatures">
|
|
272
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span></li>
|
|
273
|
+
<li class="tsd-description">
|
|
274
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span></h4></li></ul></li></ul></li></ul></div>
|
|
275
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span></h4><p>The result of the operation.</p>
|
|
276
|
+
|
|
277
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
278
|
+
<ul>
|
|
279
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L148">api/config/LDAIConfigTracker.ts:148</a></li></ul></aside></li></ul></section>
|
|
280
|
+
<section class="tsd-panel tsd-member"><a id="trackVercelAISDKStreamTextMetrics" class="tsd-anchor"></a>
|
|
281
|
+
<h3 class="tsd-anchor-link"><span>track<wbr/>VercelAISDKStream<wbr/>Text<wbr/>Metrics</span><a href="#trackVercelAISDKStreamTextMetrics" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
282
|
+
<ul class="tsd-signatures">
|
|
283
|
+
<li class="tsd-signature tsd-anchor-link" id="trackVercelAISDKStreamTextMetrics.trackVercelAISDKStreamTextMetrics-1"><span class="tsd-kind-call-signature">track<wbr/>VercelAISDKStream<wbr/>Text<wbr/>Metrics</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">func</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><a href="#trackVercelAISDKStreamTextMetrics.trackVercelAISDKStreamTextMetrics-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
284
|
+
<li class="tsd-description">
|
|
285
|
+
<div class="tsd-comment tsd-typography"><p>Track a Vercel AI SDK streamText operation.</p>
|
|
286
|
+
<p>This function will track the duration of the operation, the token usage, and the success or error status.</p>
|
|
287
|
+
<p>If the provided function throws, then this method will also throw.
|
|
288
|
+
In the case the provided function throws, this function will record the duration and an error.
|
|
289
|
+
A failed operation will not have any token usage data.</p>
|
|
290
|
+
</div>
|
|
291
|
+
<section class="tsd-panel">
|
|
292
|
+
<h4>Type Parameters</h4>
|
|
293
|
+
<ul class="tsd-type-parameter-list">
|
|
294
|
+
<li>
|
|
295
|
+
<h4><span class="tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">finishReason</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">usage</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">completionTokens</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">promptTokens</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">totalTokens</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></h4></li></ul></section>
|
|
296
|
+
<div class="tsd-parameters">
|
|
297
|
+
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
298
|
+
<ul class="tsd-parameter-list">
|
|
299
|
+
<li>
|
|
300
|
+
<h5><span class="tsd-kind-parameter">func</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span><span class="tsd-signature-symbol">)</span></h5>
|
|
301
|
+
<div class="tsd-comment tsd-typography"><p>Function which executes the operation.</p>
|
|
302
|
+
</div>
|
|
303
|
+
<ul class="tsd-parameters">
|
|
304
|
+
<li class="tsd-parameter-signature">
|
|
305
|
+
<ul class="tsd-signatures">
|
|
306
|
+
<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">TRes</span></li>
|
|
307
|
+
<li class="tsd-description">
|
|
308
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">TRes</span></h4></li></ul></li></ul></li></ul></div>
|
|
309
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">TRes</span></h4><p>The result of the operation.</p>
|
|
310
|
+
|
|
311
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
312
|
+
<ul>
|
|
313
|
+
<li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/b0ca5ee/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts#L172">api/config/LDAIConfigTracker.ts:172</a></li></ul></aside></li></ul></section></section></div>
|
|
244
314
|
<div class="col-sidebar">
|
|
245
315
|
<div class="page-menu">
|
|
246
316
|
<div class="tsd-navigation settings">
|
|
@@ -269,9 +339,11 @@ A failed operation will not have any token usage data.</p>
|
|
|
269
339
|
<li><a href="#trackOpenAIMetrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>OpenAIMetrics</span></a></li>
|
|
270
340
|
<li><a href="#trackSuccess" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Success</span></a></li>
|
|
271
341
|
<li><a href="#trackTimeToFirstToken" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Time<wbr/>To<wbr/>First<wbr/>Token</span></a></li>
|
|
272
|
-
<li><a href="#trackTokens" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Tokens</span></a></li
|
|
342
|
+
<li><a href="#trackTokens" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>Tokens</span></a></li>
|
|
343
|
+
<li><a href="#trackVercelAISDKGenerateTextMetrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>VercelAISDKGenerate<wbr/>Text<wbr/>Metrics</span></a></li>
|
|
344
|
+
<li><a href="#trackVercelAISDKStreamTextMetrics" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>track<wbr/>VercelAISDKStream<wbr/>Text<wbr/>Metrics</span></a></li></ul></div></details></div>
|
|
273
345
|
<div class="site-menu">
|
|
274
|
-
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.
|
|
346
|
+
<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>@launchdarkly/server-<wbr/>sdk-<wbr/>ai -<wbr/> v0.10.0</span></a>
|
|
275
347
|
<ul class="tsd-small-nested-navigation">
|
|
276
348
|
<li><a href="../enums/LDFeedbackKind.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g></svg><span>LDFeedback<wbr/>Kind</span></a></li>
|
|
277
349
|
<li><a href="LDAIClient.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>LDAIClient</span></a></li>
|
|
@@ -281,8 +353,13 @@ A failed operation will not have any token usage data.</p>
|
|
|
281
353
|
<li><a href="LDModelConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDModel<wbr/>Config</span></a></li>
|
|
282
354
|
<li><a href="LDProviderConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDProvider<wbr/>Config</span></a></li>
|
|
283
355
|
<li><a href="LDTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>LDToken<wbr/>Usage</span></a></li>
|
|
356
|
+
<li><a href="VercelAISDKConfig.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKConfig</span></a></li>
|
|
357
|
+
<li><a href="VercelAISDKMapOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>VercelAISDKMap<wbr/>Options</span></a></li>
|
|
284
358
|
<li><a href="../types/LDAIDefaults.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>LDAIDefaults</span></a></li>
|
|
359
|
+
<li><a href="../types/VercelAISDKProvider.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg><span>VercelAISDKProvider</span></a></li>
|
|
285
360
|
<li><a href="../functions/createBedrockTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>create<wbr/>Bedrock<wbr/>Token<wbr/>Usage</span></a></li>
|
|
361
|
+
<li><a href="../functions/createOpenAiUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>Open<wbr/>Ai<wbr/>Usage</span></a></li>
|
|
362
|
+
<li><a href="../functions/createVercelAISDKTokenUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>create<wbr/>VercelAISDKToken<wbr/>Usage</span></a></li>
|
|
286
363
|
<li><a href="../functions/initAi.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Ai</span></a></li></ul></nav></div></div></div>
|
|
287
364
|
<div class="tsd-generator">
|
|
288
365
|
<p>Generated using <a href="https://typedoc.org/" rel="noopener" target="_blank">TypeDoc</a></p></div>
|