Update suite_app.js for tool calling fixes
This commit is contained in:
parent
1bf9510c7d
commit
123787378f
1 changed files with 10 additions and 5 deletions
|
|
@ -698,15 +698,20 @@ const Omnibox = {
|
||||||
|
|
||||||
// Initialize Omnibox when DOM is ready
|
// Initialize Omnibox when DOM is ready
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
// Detect bot name from pathname (e.g., /edu -> bot_name = "edu")
|
// Detect bot name from pathname (e.g., /bot/cristo -> bot_name = "cristo", /edu -> bot_name = "edu")
|
||||||
const detectBotFromPath = () => {
|
const detectBotFromPath = () => {
|
||||||
const pathname = window.location.pathname;
|
const pathname = window.location.pathname;
|
||||||
// Remove leading/trailing slashes and get first segment
|
// Remove leading/trailing slashes and split
|
||||||
const segments = pathname.replace(/^\/|\/$/g, "").split("/");
|
const segments = pathname.replace(/^\/|\/$/g, "").split("/");
|
||||||
const firstSegment = segments[0];
|
|
||||||
|
|
||||||
// If first segment is not a known route, treat it as bot name
|
// Handle /bot/{bot_name} pattern
|
||||||
const knownRoutes = ["suite", "auth", "api", "static", "public"];
|
if (segments[0] === "bot" && segments[1]) {
|
||||||
|
return segments[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// For other patterns, use first segment if it's not a known route
|
||||||
|
const firstSegment = segments[0];
|
||||||
|
const knownRoutes = ["suite", "auth", "api", "static", "public", "bot"];
|
||||||
if (firstSegment && !knownRoutes.includes(firstSegment)) {
|
if (firstSegment && !knownRoutes.includes(firstSegment)) {
|
||||||
return firstSegment;
|
return firstSegment;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue