Skip to content

Commit 5b58073

Browse files
committed
LlamaIndex: Use cratedb-about 0.0.6
1 parent 55f2fa3 commit 5b58073

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

topic/machine-learning/llama-index/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Answer was: The average value for sensor 1 is 17.033333333333335.
136136
Spin up the [CrateDB MCP server], connecting it to CrateDB on localhost.
137137
```bash
138138
export CRATEDB_CLUSTER_URL=http://crate:crate@localhost:4200/
139-
export CRATEDB_MCP_TRANSPORT=streamable-http
139+
export CRATEDB_MCP_TRANSPORT=http
140140
uvx cratedb-mcp serve
141141
```
142142

topic/machine-learning/llama-index/demo_mcp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
## Start CrateDB MCP Server
88
```
99
export CRATEDB_CLUSTER_URL="http://localhost:4200/"
10-
cratedb-mcp serve --transport=streamable-http
10+
cratedb-mcp serve --transport=http
1111
```
1212
1313
## Usage
@@ -20,7 +20,7 @@
2020
import asyncio
2121
import os
2222

23-
from cratedb_about.instruction import Instructions
23+
from cratedb_about.instruction import GeneralInstructions
2424

2525
from dotenv import load_dotenv
2626
from llama_index.core.agent.workflow import FunctionAgent
@@ -36,7 +36,7 @@ def __init__(self, llm: LLM):
3636
self.llm = llm
3737

3838
async def get_tools(self):
39-
# Connect to the CrateDB MCP server using `streamable-http` transport.
39+
# Connect to the CrateDB MCP server using the `http` transport.
4040
mcp_url = os.getenv("CRATEDB_MCP_URL", "http://127.0.0.1:8000/mcp/")
4141
mcp_client = BasicMCPClient(mcp_url)
4242
mcp_tool_spec = McpToolSpec(
@@ -50,11 +50,11 @@ async def get_tools(self):
5050

5151
async def get_agent(self):
5252
return FunctionAgent(
53-
name="Agent",
53+
name="DemoAgent",
5454
description="CrateDB text-to-SQL agent",
5555
llm=self.llm,
5656
tools=await self.get_tools(),
57-
system_prompt=Instructions.full(),
57+
system_prompt=GeneralInstructions().render(),
5858
)
5959

6060
async def aquery(self, query):

topic/machine-learning/llama-index/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cratedb-about @ git+https://github.com/crate/about.git@instructions
1+
cratedb-about==0.0.6
22
langchain-openai<0.4
33
llama-index-embeddings-langchain<0.4
44
llama-index-embeddings-openai<0.4

0 commit comments

Comments
 (0)