Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Commit 14cc65b

Browse files
add google analytics (#2053)
Co-authored-by: Alex Yang <himself65@outlook.com>
1 parent c544d8f commit 14cc65b

4 files changed

Lines changed: 50 additions & 27 deletions

File tree

apps/next/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
"dependencies": {
1616
"@huggingface/transformers": "^3.5.0",
1717
"@icons-pack/react-simple-icons": "^10.1.0",
18-
"@llamaindex/workflow-docs": "0.1.1",
1918
"@llamaindex/chat-ui-docs": "^0.0.5",
2019
"@llamaindex/cloud": "workspace:*",
2120
"@llamaindex/core": "workspace:*",
2221
"@llamaindex/node-parser": "workspace:*",
2322
"@llamaindex/openai": "workspace:*",
2423
"@llamaindex/readers": "workspace:*",
2524
"@llamaindex/workflow": "workspace:*",
25+
"@llamaindex/workflow-docs": "0.1.1",
2626
"@mdx-js/mdx": "^3.1.0",
2727
"@monaco-editor/react": "^4.7.0",
28+
"@next/third-parties": "^15.3.4",
2829
"@number-flow/react": "^0.3.4",
2930
"@radix-ui/react-dialog": "^1.1.2",
3031
"@radix-ui/react-icons": "^1.3.2",

apps/next/src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AIProvider } from "@/actions";
22
import { TooltipProvider } from "@/components/ui/tooltip";
3+
import { GoogleAnalytics } from "@next/third-parties/google";
34
import { RootProvider } from "fumadocs-ui/provider";
45
import { Inter } from "next/font/google";
56
import type { ReactNode } from "react";
@@ -39,6 +40,7 @@ export default function Layout({ children }: { children: ReactNode }) {
3940
</AIProvider>
4041
</TooltipProvider>
4142
</body>
43+
<GoogleAnalytics gaId="G-NB9B8LW9W5" />
4244
</html>
4345
);
4446
}

apps/next/src/content/docs/llamaindex/modules/data/memory/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ console.log("Response:", result.data.result);
5353

5454
You can also put messages in Vercel format directly to the memory:
5555

56-
```ts twoslash
56+
```ts
5757
await memory.add({
5858
id: "1",
5959
createdAt: new Date(),
@@ -73,7 +73,7 @@ await memory.add({
7373

7474
If you call `get`, messages are usually retrieved in the LlamaIndexTS format (type `ChatMessage`). If you specify the `type` parameter using `get`, you can return the messages in different formats. E.g.: using `type: "vercel"`, you can return the messages in Vercel format:
7575

76-
```ts twoslash
76+
```ts
7777
const messages = await memory.get({ type: "vercel" });
7878
console.log(messages);
7979
```
@@ -95,7 +95,7 @@ For initialization, you call `createMemory` with the following options:
9595

9696
Example:
9797

98-
```ts twoslash
98+
```ts
9999
const memory = createMemory({
100100
tokenLimit=40000,
101101
shortTermTokenLimitRatio=0.5,
@@ -113,7 +113,7 @@ Currently, there are two predefined memory blocks:
113113

114114
This sounds a bit complicated, but it's actually quite simple. Let's look at an example:
115115

116-
```ts twoslash
116+
```ts
117117
import { createMemory, factExtractionBlock, staticBlock } from "llamaindex";
118118

119119
const memoryBlocks= [
@@ -142,7 +142,7 @@ You'll also notice that we've set the `priority` for the `factExtractionBlock` b
142142

143143
Now, let's pass these blocks into the `createMemory` function:
144144

145-
```ts twoslash
145+
```ts
146146
const memory = createMemory({
147147
tokenLimit: 40000,
148148
memoryBlocks: memoryBlocks,

pnpm-lock.yaml

Lines changed: 41 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)