Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

feature: add script to embed the entelligence chat (#700)

fernando-plankb222ff441f2c
diff --git a/docs/v1/scripts/entelligence.js b/docs/v1/scripts/entelligence.js
index 45452450..56d80e3a 100644
--- a/docs/v1/scripts/entelligence.js
+++ b/docs/v1/scripts/entelligence.js
@@ -6,32 +6,38 @@ function initEntelligence() {
chatScript.type = "module";
chatScript.id = "entelligence-chat";
chatScript.src =
- "https://d345f39z3arwqc.cloudfront.net/entelligence-chat.js";
+ "https://dujj2xy9pc7vi.cloudfront.net/vanilla/entelligence-chat.umd.js";
+ chatScript.defer = true; // Add defer to load after HTML parsing
// Create initialization script
const initScript = document.createElement("script");
- initScript.type = "module";
+ initScript.type = "module";
initScript.textContent = `
window.EntelligenceChat.init({
analyticsData: {
repoName: "agentops",
- organization: "AgentOps-AI",
+ organization: "AgentOps-AI",
apiKey: "1234567890",
- theme: 'dark'
+ theme: 'dark',
+ companyName: "AgentOps"
}
});
`;
- // Append initialization script after chat script loads
+ // Add to head instead of body for better performance
+ const head = document.getElementsByTagName("head")[0];
+ head.appendChild(chatScript);
+
+ // Initialize after script loads
chatScript.onload = () => {
- document.body.appendChild(initScript);
+ document.head.appendChild(initScript);
};
-
- // Append chat script to the body
- document.body.appendChild(chatScript);
}
}
-window.addEventListener("load", function () {
+// Run when DOM is ready
+if (document.readyState === 'loading') {
+ document.addEventListener('DOMContentLoaded', initEntelligence);
+} else {
initEntelligence();
-});
+}