@launchdarkly/server-sdk-ai 0.7.1 → 0.8.1

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.
@@ -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>LDProviderConfig | @launchdarkly/server-sdk-ai - v0.7.1</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">
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDProviderConfig | @launchdarkly/server-sdk-ai - v0.8.1</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.7.1</a></div>
9
+ <li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.8.1</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">
@@ -20,7 +20,7 @@
20
20
  <ul class="tsd-hierarchy">
21
21
  <li><span class="target">LDProviderConfig</span></li></ul></section><aside class="tsd-sources">
22
22
  <ul>
23
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L23">api/config/LDAIConfig.ts:23</a></li></ul></aside>
23
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L23">api/config/LDAIConfig.ts:23</a></li></ul></aside>
24
24
  <section class="tsd-panel-group tsd-index-group">
25
25
  <section class="tsd-panel tsd-index-panel">
26
26
  <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
41
41
  <ul>
42
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L27">api/config/LDAIConfig.ts:27</a></li></ul></aside></section></section></div>
42
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L27">api/config/LDAIConfig.ts:27</a></li></ul></aside></section></section></div>
43
43
  <div class="col-sidebar">
44
44
  <div class="page-menu">
45
45
  <div class="tsd-navigation settings">
@@ -61,7 +61,7 @@
61
61
  <ul>
62
62
  <li><a href="#name" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>name</span></a></li></ul></div></details></div>
63
63
  <div class="site-menu">
64
- <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.7.1</span></a>
64
+ <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.8.1</span></a>
65
65
  <ul class="tsd-small-nested-navigation">
66
66
  <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>
67
67
  <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>
@@ -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>LDTokenUsage | @launchdarkly/server-sdk-ai - v0.7.1</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">
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDTokenUsage | @launchdarkly/server-sdk-ai - v0.8.1</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.7.1</a></div>
9
+ <li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.8.1</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">LDTokenUsage</span></li></ul></section><aside class="tsd-sources">
26
26
  <ul>
27
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L4">api/metrics/LDTokenUsage.ts:4</a></li></ul></aside>
27
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L4">api/metrics/LDTokenUsage.ts:4</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">
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
47
47
  <ul>
48
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L13">api/metrics/LDTokenUsage.ts:13</a></li></ul></aside></section>
48
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L13">api/metrics/LDTokenUsage.ts:13</a></li></ul></aside></section>
49
49
  <section class="tsd-panel tsd-member"><a id="output" class="tsd-anchor"></a>
50
50
  <h3 class="tsd-anchor-link"><span>output</span><a href="#output" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
51
51
  <div class="tsd-signature"><span class="tsd-kind-property">output</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
@@ -53,7 +53,7 @@
53
53
  </div>
54
54
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
55
55
  <ul>
56
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L18">api/metrics/LDTokenUsage.ts:18</a></li></ul></aside></section>
56
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L18">api/metrics/LDTokenUsage.ts:18</a></li></ul></aside></section>
57
57
  <section class="tsd-panel tsd-member"><a id="total" class="tsd-anchor"></a>
58
58
  <h3 class="tsd-anchor-link"><span>total</span><a href="#total" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
59
59
  <div class="tsd-signature"><span class="tsd-kind-property">total</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
@@ -61,7 +61,7 @@
61
61
  </div>
62
62
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
63
63
  <ul>
64
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L8">api/metrics/LDTokenUsage.ts:8</a></li></ul></aside></section></section></div>
64
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/metrics/LDTokenUsage.ts#L8">api/metrics/LDTokenUsage.ts:8</a></li></ul></aside></section></section></div>
65
65
  <div class="col-sidebar">
66
66
  <div class="page-menu">
67
67
  <div class="tsd-navigation settings">
@@ -85,7 +85,7 @@
85
85
  <li><a href="#output" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>output</span></a></li>
86
86
  <li><a href="#total" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>total</span></a></li></ul></div></details></div>
87
87
  <div class="site-menu">
88
- <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.7.1</span></a>
88
+ <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.8.1</span></a>
89
89
  <ul class="tsd-small-nested-navigation">
90
90
  <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>
91
91
  <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>
@@ -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>LDAIDefaults | @launchdarkly/server-sdk-ai - v0.7.1</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">
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>LDAIDefaults | @launchdarkly/server-sdk-ai - v0.8.1</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.7.1</a></div>
9
+ <li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@launchdarkly/server-sdk-ai - v0.8.1</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">
@@ -30,7 +30,7 @@ a tracker and <code>enabled</code> is optional.</p>
30
30
  <div class="tsd-comment tsd-typography"></div></li></ul></div>
31
31
  <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
32
32
  <ul>
33
- <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/1ff96ce/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L77">api/config/LDAIConfig.ts:77</a></li></ul></aside></div>
33
+ <li>Defined in <a href="https://github.com/launchdarkly/js-core/blob/76347d8/packages/sdk/server-ai/src/api/config/LDAIConfig.ts#L77">api/config/LDAIConfig.ts:77</a></li></ul></aside></div>
34
34
  <div class="col-sidebar">
35
35
  <div class="page-menu">
36
36
  <div class="tsd-navigation settings">
@@ -47,7 +47,7 @@ a tracker and <code>enabled</code> is optional.</p>
47
47
  <div class="tsd-theme-toggle">
48
48
  <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
49
49
  <div class="site-menu">
50
- <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.7.1</span></a>
50
+ <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.8.1</span></a>
51
51
  <ul class="tsd-small-nested-navigation">
52
52
  <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>
53
53
  <li><a href="../interfaces/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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@launchdarkly/server-sdk-ai",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "LaunchDarkly AI SDK for Server-Side JavaScript",
5
5
  "homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/server-ai",
6
6
  "repository": {
@@ -41,6 +41,16 @@ export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
41
41
  }
42
42
  }
43
43
 
44
+ trackTimeToFirstToken(timeToFirstTokenMs: number) {
45
+ this._trackedMetrics.timeToFirstTokenMs = timeToFirstTokenMs;
46
+ this._ldClient.track(
47
+ '$ld:ai:tokens:ttf',
48
+ this._context,
49
+ this._getTrackData(),
50
+ timeToFirstTokenMs,
51
+ );
52
+ }
53
+
44
54
  trackFeedback(feedback: { kind: LDFeedbackKind }): void {
45
55
  this._trackedMetrics.feedback = feedback;
46
56
  if (feedback.kind === LDFeedbackKind.Positive) {
@@ -8,22 +8,21 @@ import { LDAIConfig, LDAIDefaults } from './config/LDAIConfig';
8
8
  export interface LDAIClient {
9
9
  /**
10
10
  * Retrieves and processes an AI configuration based on the provided key, LaunchDarkly context,
11
- * and variables. This includes the model configuration and the processed prompts.
11
+ * and variables. This includes the model configuration and the customized messages.
12
12
  *
13
13
  * @param key The key of the AI configuration.
14
14
  * @param context The LaunchDarkly context object that contains relevant information about the
15
15
  * current environment, user, or session. This context may influence how the configuration is
16
16
  * processed or personalized.
17
+ * @param defaultValue A fallback value containing model configuration and messages. This will
18
+ * be used if the configuration is not available from LaunchDarkly.
17
19
  * @param variables A map of key-value pairs representing dynamic variables to be injected into
18
- * the prompt template. The keys correspond to placeholders within the template, and the values
20
+ * the message content. The keys correspond to placeholders within the template, and the values
19
21
  * are the corresponding replacements.
20
- * @param defaultValue A fallback value containing model configuration and prompts. This will
21
- * be used if the configurationuration is not available from launchdarkly.
22
22
  *
23
- * @returns The AI configurationuration including a processed prompt after all variables have been
24
- * substituted in the stored prompt template. This will also include a `tracker` used to track
25
- * the state of the AI operation. If the configuration cannot be accessed from LaunchDarkly, then
26
- * the return value will include information from the defaultValue.
23
+ * @returns The AI `config`, customized `messages`, and a `tracker`. If the configuration cannot be accessed from
24
+ * LaunchDarkly, then the return value will include information from the `defaultValue`. The returned `tracker` can
25
+ * be used to track AI operation metrics (latency, token usage, etc.).
27
26
  *
28
27
  * @example
29
28
  * ```
@@ -34,7 +33,7 @@ export interface LDAIClient {
34
33
  * enabled: false,
35
34
  * };
36
35
  *
37
- * const result = modelConfig(key, context, defaultValue, variables);
36
+ * const result = config(key, context, defaultValue, variables);
38
37
  * // Output:
39
38
  * {
40
39
  * enabled: true,
@@ -44,7 +43,7 @@ export interface LDAIClient {
44
43
  * maxTokens: 4096,
45
44
  * userDefinedKey: "myValue",
46
45
  * },
47
- * prompt: [
46
+ * messages: [
48
47
  * {
49
48
  * role: "system",
50
49
  * content: "You are an amazing GPT."
@@ -23,6 +23,11 @@ export interface LDAIMetricSummary {
23
23
  * Any sentiment about the generation.
24
24
  */
25
25
  feedback?: { kind: LDFeedbackKind };
26
+
27
+ /**
28
+ * Time to first token for this generation.
29
+ */
30
+ timeToFirstTokenMs?: number;
26
31
  }
27
32
 
28
33
  /**
@@ -62,6 +67,13 @@ export interface LDAIConfigTracker {
62
67
  */
63
68
  trackFeedback(feedback: { kind: LDFeedbackKind }): void;
64
69
 
70
+ /**
71
+ * Track the time to first token for this generation.
72
+ *
73
+ * @param timeToFirstTokenMs The duration in milliseconds.
74
+ */
75
+ trackTimeToFirstToken(timeToFirstTokenMs: number): void;
76
+
65
77
  /**
66
78
  * Track the duration of execution of the provided function.
67
79
  *