@gsa-tts/graymatter-ui 0.4.15 → 0.4.17
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/dist/graymatter-ui.js +1243 -1243
- package/dist/graymatter-ui.umd.cjs +24 -24
- package/package.json +1 -1
- package/src/components/ApiDocSubNavMenu.svelte +10 -4
- package/src/components/DesktopSideNav.svelte +0 -1
- package/src/content/api/endpoints.mdx +1 -8
- package/src/content/api/getting-started.mdx +1 -8
- package/src/utils/generateApiNavData.ts +3 -2
package/package.json
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
import ApiDocSubNavList from './ApiDocSubNavList.svelte';
|
|
6
6
|
|
|
7
7
|
const { data = null } = $props();
|
|
8
|
+
// TODO: remove legacy /api/documentation path once all consuming apps migrate
|
|
9
|
+
const API_DOC_PATHS = ['/api-documentation', '/api/documentation'];
|
|
10
|
+
|
|
11
|
+
function isApiDocumentationPath(path: string | null | undefined) {
|
|
12
|
+
if (!path) return false;
|
|
13
|
+
return API_DOC_PATHS.some(apiPath => path.includes(apiPath));
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
const sections = $derived(() =>
|
|
10
17
|
!Array.isArray(data) &&
|
|
@@ -232,8 +239,7 @@
|
|
|
232
239
|
// Only do this if we're on the API documentation page (where this component exists)
|
|
233
240
|
if (data && effectiveSelectedId() && typeof window !== 'undefined') {
|
|
234
241
|
const currentPath = window.location.pathname;
|
|
235
|
-
const isApiDocumentationPage =
|
|
236
|
-
currentPath.includes('/api/documentation');
|
|
242
|
+
const isApiDocumentationPage = isApiDocumentationPath(currentPath);
|
|
237
243
|
|
|
238
244
|
if (isApiDocumentationPage) {
|
|
239
245
|
const restoredItem = findItemById(data, effectiveSelectedId()!);
|
|
@@ -259,13 +265,13 @@
|
|
|
259
265
|
// Check if we're navigating TO the documentation page (vs refreshing while on it)
|
|
260
266
|
if (typeof window !== 'undefined') {
|
|
261
267
|
const currentPath = window.location.pathname;
|
|
262
|
-
const isDocumentationPage = currentPath
|
|
268
|
+
const isDocumentationPage = isApiDocumentationPath(currentPath);
|
|
263
269
|
|
|
264
270
|
// If we're on the documentation page, check if we came from a different page
|
|
265
271
|
if (isDocumentationPage) {
|
|
266
272
|
const referrer = document.referrer;
|
|
267
273
|
const isFromDifferentPage =
|
|
268
|
-
referrer && !referrer
|
|
274
|
+
referrer && !isApiDocumentationPath(referrer);
|
|
269
275
|
|
|
270
276
|
// If we came from a different page, clear sessionStorage to reset to initial values
|
|
271
277
|
if (isFromDifferentPage) {
|
|
@@ -26,12 +26,6 @@ curl -X 'GET' \
|
|
|
26
26
|
{
|
|
27
27
|
"object": "list",
|
|
28
28
|
"data": [
|
|
29
|
-
{
|
|
30
|
-
"id": "claude_3_5_sonnet",
|
|
31
|
-
"created": 1718841600,
|
|
32
|
-
"object": "model",
|
|
33
|
-
"owned_by": "Anthropic"
|
|
34
|
-
},
|
|
35
29
|
{
|
|
36
30
|
"id": "llama3211b",
|
|
37
31
|
"created": 1727222400,
|
|
@@ -55,7 +49,7 @@ To reach chat completions the documented endpoint is `<base url>/api/v1/chat/com
|
|
|
55
49
|
|
|
56
50
|
**Request Body**
|
|
57
51
|
|
|
58
|
-
* **model**: The model ID (e.g: gemini-2.0-flash
|
|
52
|
+
* **model**: The model ID (e.g: gemini-2.0-flash)
|
|
59
53
|
* **messages**: An array of of message items consisting of User message, Image Content, Document Content, Assistant Message
|
|
60
54
|
* **max_tokens**: Maximum response length (optional)
|
|
61
55
|
* **temperature**: Response creativity (0.0-2.0, optional)
|
|
@@ -63,7 +57,6 @@ To reach chat completions the documented endpoint is `<base url>/api/v1/chat/com
|
|
|
63
57
|
| **Models** | **Range** | **Default value** |
|
|
64
58
|
| :------- | :------: | -------: |
|
|
65
59
|
| Google models | 0.0 - 2.0 | 1.0 |
|
|
66
|
-
| Anthropic models | 0.0 - 1.0 | 0.5 |
|
|
67
60
|
| Meta models | 0.0 - 1.0 | 0.5 |
|
|
68
61
|
|
|
69
62
|
* **top_p**: An alternative to sampling with temperature, called nucleus sampling (optional)
|
|
@@ -18,13 +18,6 @@ USAi API is organized around [REST](http://en.wikipedia.org/wiki/Representationa
|
|
|
18
18
|
- [Gemini 2.5 Flash](https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash)
|
|
19
19
|
- [Gemini 2.5 Pro](https://ai.google.dev/gemini-api/docs/models#gemini-2.5-pro)
|
|
20
20
|
|
|
21
|
-
**Anthropic models**
|
|
22
|
-
- [Claude Haiku 3.5](https://docs.claude.com/en/docs/overview)
|
|
23
|
-
- [Claude Sonnet 3.7](https://docs.claude.com/en/docs/overview)
|
|
24
|
-
- [Claude Sonnet 4](https://docs.claude.com/en/docs/overview)
|
|
25
|
-
- [Claude Sonnet 4.5](https://docs.claude.com/en/docs/overview)
|
|
26
|
-
- [Claude Opus 4](https://docs.claude.com/en/docs/overview)
|
|
27
|
-
- [Claude Opus 4.5](https://docs.claude.com/en/docs/overview)
|
|
28
21
|
|
|
29
22
|
**Meta models**
|
|
30
23
|
- [Llama 3.2 11B](https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/)
|
|
@@ -40,7 +33,7 @@ Each model we draw on has unique capabilities. Models may also respond different
|
|
|
40
33
|
|
|
41
34
|
#### Content types
|
|
42
35
|
|
|
43
|
-
The models USAi API draws on support multiple types of inputs; text, image, and file content types.
|
|
36
|
+
The models USAi API draws on support multiple types of inputs; text, image, and file content types. For additional detail about how we handle these content types, reference [OpenAI’s API documentation](https://platform.openai.com/docs/api-reference/chat/create).
|
|
44
37
|
|
|
45
38
|
### Authentication
|
|
46
39
|
|
|
@@ -82,7 +82,8 @@ function headingsToNavItems(
|
|
|
82
82
|
|
|
83
83
|
// Generate navigation data dynamically from API documentation metadata
|
|
84
84
|
export function generateApiDocumentationNavData(
|
|
85
|
-
apiDocs: ApiDocMetadata[]
|
|
85
|
+
apiDocs: ApiDocMetadata[],
|
|
86
|
+
basePath = '/api-documentation'
|
|
86
87
|
): SubNavData {
|
|
87
88
|
// Sort by sortOrder
|
|
88
89
|
const sortedDocs = [...apiDocs].sort((a, b) => a.sortOrder - b.sortOrder);
|
|
@@ -97,7 +98,7 @@ export function generateApiDocumentationNavData(
|
|
|
97
98
|
return {
|
|
98
99
|
id: doc.slug,
|
|
99
100
|
title: doc.title,
|
|
100
|
-
href:
|
|
101
|
+
href: `${basePath}#${doc.slug}`,
|
|
101
102
|
children,
|
|
102
103
|
};
|
|
103
104
|
});
|