Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions api-playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ <h4 style="margin-top:0;">Chat with <strong id="active-agent-name"
<div class="input-group">
<label for="qs-agent-id">Agent ID</label>
<input type="text" id="qs-agent-id">
<p>A short, unique name. The prefix `system-` will be added automatically.
<p>A short, unique name. The prefix "<code>system-</code>" will be added automatically.
</p>
</div>
<div class="input-group">
Expand All @@ -1156,7 +1156,7 @@ <h4 style="margin-top:0;">Chat with <strong id="active-agent-name"
<textarea id="qs-agent-prompt"
placeholder="You are a helpful assistant that specializes in..."></textarea>
<div class="drop-zone-prompt">
<p>Drag & drop a .md file here, or</p>
<p>Drag & drop a Markdown (<code>.md</code>) file here, or</p>
<label for="markdown-file-input" class="btn btn-secondary">Click to
Upload</label>
<input type="file" id="markdown-file-input" accept=".md,.txt,text/markdown">
Expand Down Expand Up @@ -1213,8 +1213,8 @@ <h3>Step 5: Modify Session Settings</h3>
<div class="timeline-item right">
<div class="timeline-content" id="qs-step-6-ask-question">
<h3>Step 6: Ask a Question</h3>
<p>With our session configured, we can interact with it. Your `Session ID` and any selected
functions are automatically included in the request.</p>
<p>With our session configured, we can interact with it. Your <i>Session ID</i> and any selected
functions will be automatically included in the request.</p>
<div class="input-group">
<label for="qs-question">Your Question</label>
<input type="text" id="qs-question" class="global-state-input" data-state-key="question">
Expand Down Expand Up @@ -1303,9 +1303,9 @@ <h3 id="api-categories">API Categories</h3>
oauthEndpoints: null,
isAgentSession: false,
currentAgent: null,
availableFunctions: [], // Handles functions fetched from the API
availableAgents: [], // Handles agents fetched from the API
currentSessionTools: [], // Handles tools bound to the current session
availableFunctions: [], // Handles functions fetched from the API
availableAgents: [], // Handles agents fetched from the API
currentSessionTools: [], // Handles tools bound to the current session
lastChatCompletionBody: null, // Handles last chat completion request body
},

Expand Down Expand Up @@ -3121,7 +3121,7 @@ <h5>Bind Functions to Session</h5>
return await processResponse(response);
} else {
if (response.status === 404) {
throw new Error(`Server returned 404 (Not Found). Please check if the Endpoint URL is correct and if it supports OpenID discovery.`);
throw new Error(`Server returned 404 (Not Found). Please check whether the Endpoint URL is correct and whether it supports OpenID discovery.`);
} else if (response.status >= 500) {
throw new Error(`The server experienced an internal error (Status: ${response.status}). Please try again later.`);
} else {
Expand Down Expand Up @@ -3214,7 +3214,7 @@ <h5>Bind Functions to Session</h5>
return t;
};

// Root key: prefer metadata.id, else H1 title fallback
// Root key: prefer metadata.id, else fallback to H1 title
const h1 = (text.match(/^\s*#\s*(.+)$/m) || [, null])[1];
const rootKey = (metadata && metadata.id) ? String(metadata.id) : (h1 ? toCamel(h1) : 'agent');
const root = { [rootKey]: Object.assign({}, metadata || {}) };
Expand Down