Skip to content

Commit

Permalink
Updates Github stars with dynamic data using MDX + <script>
Browse files Browse the repository at this point in the history
Same format will fix #267
  • Loading branch information
albertkimjunior committed Jun 27, 2024
1 parent 0467aee commit 2a685b7
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 28 deletions.
Binary file added docs/images/external/logo/banner-badge-docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 0 additions & 17 deletions docs/snippets/github-stars.js

This file was deleted.

21 changes: 19 additions & 2 deletions docs/v1/integrations/autogen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Autogen has comprehensive [documentation](https://microsoft.github.io/autogen/do
```
</CodeGroup>
<Check>
[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our 1,000th 😊)
[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)
</Check>
</Step>
<Step title="Install Autogen">
Expand Down Expand Up @@ -80,4 +80,21 @@ Autogen has comprehensive [documentation](https://microsoft.github.io/autogen/do
<img height="200" src="https://github.com/AgentOps-AI/agentops/blob/cf67191f13e0e2a09446a61b7393e1810b3eee95/docs/images/link-to-session.gif?raw=true" />
</Frame>
</Step>
</Steps>
</Steps>

<script>
{window.addEventListener('load', function() {
fetch("https://api.github.com/repos/AgentOps-AI/agentops")
.then((response) => response.json())
.then((data) => {
const stars = Math.ceil(data.stargazers_count / 1000) * 1000;
const dataContainer = document.getElementById("stars-text");
dataContainer.innerHTML = `${stars.toLocaleString()}th`;

})
.catch((error) => {
console.error("Error:", error);
document.getElementById("stars-text").textContent = 'Error loading data.';
});
})}
</script>
21 changes: 19 additions & 2 deletions docs/v1/integrations/cohere.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This is a living integration. Should you need any added functionality message us
poetry add agentops
```
</CodeGroup>
<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our 1,000th 😊)</Check>
<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)</Check>
</Step>
<Step title="Add 3 lines of code">
<CodeGroup>
Expand Down Expand Up @@ -113,4 +113,21 @@ This is a living integration. Should you need any added functionality message us

agentops.end_session('Success')
```
</CodeGroup>
</CodeGroup>

<script>
{window.addEventListener('load', function() {
fetch("https://api.github.com/repos/AgentOps-AI/agentops")
.then((response) => response.json())
.then((data) => {
const stars = Math.ceil(data.stargazers_count / 1000) * 1000;
const dataContainer = document.getElementById("stars-text");
dataContainer.innerHTML = `${stars.toLocaleString()}th`;

})
.catch((error) => {
console.error("Error:", error);
document.getElementById("stars-text").textContent = 'Error loading data.';
});
})}
</script>
21 changes: 19 additions & 2 deletions docs/v1/integrations/crewai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Crew has comprehensive [documentation](https://docs.crewai.com) available as wel
```
</CodeGroup>
<Check>
[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our 1,000th 😊)
[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">2,000th</span> 😊)
</Check>
</Step>
<Step title="Install Crew from the AgentOps fork">
Expand Down Expand Up @@ -106,4 +106,21 @@ agentops.init(skip_auto_end_session=True)
<Card title="Job Posting" icon="briefcase" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/job-posting" />
<Card title="Instagram Post" icon="instagram" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/instagram_post" />
<Card title="Markdown Validator" icon="markdown" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/markdown_validator" />
</CardGroup>
</CardGroup>

<script>
{window.addEventListener('load', function() {
fetch("https://api.github.com/repos/AgentOps-AI/agentops")
.then((response) => response.json())
.then((data) => {
const stars = Math.ceil(data.stargazers_count / 1000) * 1000;
const dataContainer = document.getElementById("stars-text");
dataContainer.innerHTML = `${stars.toLocaleString()}th`;

})
.catch((error) => {
console.error("Error:", error);
document.getElementById("stars-text").textContent = 'Error loading data.';
});
})}
</script>
17 changes: 17 additions & 0 deletions docs/v1/integrations/litellm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,20 @@ response = litellm.completion(model="claude-3", messages=messages)
response = await litellm.acompletion(model="claude-3", messages=messages)

```

<script>
{window.addEventListener('load', function() {
fetch("https://api.github.com/repos/AgentOps-AI/agentops")
.then((response) => response.json())
.then((data) => {
const stars = Math.ceil(data.stargazers_count / 1000) * 1000;
const dataContainer = document.getElementById("stars-text");
dataContainer.innerHTML = `${stars.toLocaleString()}th`;

})
.catch((error) => {
console.error("Error:", error);
document.getElementById("stars-text").textContent = 'Error loading data.';
});
})}
</script>
19 changes: 18 additions & 1 deletion docs/v1/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Build your next agent with evals, observability, and replays"
mode: "wide"
---

<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub if you find AgentOps helpful (you may be our 1,000th 😊)</Check>
<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub if you find AgentOps helpful (you may be our <span id="stars-text">2,000th</span> 😊)</Check>

# AgentOps is your new terminal

Expand Down Expand Up @@ -58,3 +58,20 @@ View a meta-analysis of all of your sessions in a single view.
<Frame type="glass" caption="Session Overview">
<img height="200" src="https://github.com/AgentOps-AI/agentops/blob/cf67191f13e0e2a09446a61b7393e1810b3eee95/docs/images/overview.png?raw=true" />
</Frame>

<script>
{window.addEventListener('load', function() {
fetch("https://api.github.com/repos/AgentOps-AI/agentops")
.then((response) => response.json())
.then((data) => {
const stars = Math.ceil(data.stargazers_count / 1000) * 1000;
const dataContainer = document.getElementById("stars-text");
dataContainer.innerHTML = `${stars.toLocaleString()}th`;

})
.catch((error) => {
console.error("Error:", error);
document.getElementById("stars-text").textContent = 'Error loading data.';
});
})}
</script>
26 changes: 22 additions & 4 deletions docs/v1/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
title: "Quickstart"
description: "Start using AgentOps with just 2 lines of code"
---
import { GithubStars } from '/snippets/github-stars'
import SupportedModels from '/snippets/supported-models.mdx'
import SupportedModels from '/snippets/supported-models.mdx'

<Steps>
<Step title="Install the AgentOps SDK">
Expand All @@ -15,7 +14,6 @@ import SupportedModels from '/snippets/supported-models.mdx'
poetry add agentops
```
</CodeGroup>
<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <GithubStars /> 😊)</Check>
</Step>
<Step title="Add 2 lines of code">
<CodeGroup>
Expand Down Expand Up @@ -63,6 +61,9 @@ import SupportedModels from '/snippets/supported-models.mdx'
</Step>
</Steps>

<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) if you liked AgentOps! (you may be our <span id="stars-text">2,000th</span> 😊)</Check>
<Test />


## More basic functionality

Expand Down Expand Up @@ -154,4 +155,21 @@ agentops.end_session('Success')
<Card title="Tracking Agents" icon="robot" href="/v1/usage/tracking-agents">
Associate Events with specific named agents.
</Card>
</CardGroup>
</CardGroup>

<script>
{window.addEventListener('load', function() {
fetch("https://api.github.com/repos/AgentOps-AI/agentops")
.then((response) => response.json())
.then((data) => {
const stars = Math.ceil(data.stargazers_count / 1000) * 1000;
const dataContainer = document.getElementById("stars-text");
dataContainer.innerHTML = `${stars.toLocaleString()}th`;

})
.catch((error) => {
console.error("Error:", error);
document.getElementById("stars-text").textContent = 'Error loading data.';
});
})}
</script>

0 comments on commit 2a685b7

Please sign in to comment.