Skip to content

Commit 0411b34

Browse files
committed
update readme
1 parent eeac605 commit 0411b34

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ all-in-rag/
204204

205205
- 🚨 **Bug报告**:发现问题请提交 [Issue](https://github.com/datawhalechina/all-in-rag/issues)
206206
- 💭 **教程建议**:有好的想法欢迎在 [Discussions](https://github.com/datawhalechina/all-in-rag/discussions) 中讨论
207-
- 📚 **文档改进**:帮助完善文档内容和示例代码(当前仅支持第七章优质内容pr
207+
- 📚 **文档改进**:帮助完善文档内容和示例代码(当前仅支持 Extra-chapter 优质内容pr
208208

209209
## Star History
210210

code/C1/02_llamaIndex_example.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
# os.environ['HF_ENDPOINT']='https://hf-mirror.com'
33
from dotenv import load_dotenv
44
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
5-
from llama_index.llms.openai import OpenAI
5+
from llama_index.llms.openai_like import OpenAILike
66
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
77

88
load_dotenv()
99

1010
# 使用 AIHubmix
11-
Settings.llm = OpenAI(
11+
Settings.llm = OpenAILike(
1212
model="glm-4.7-flash-free",
1313
api_key=os.getenv("DEEPSEEK_API_KEY"),
14-
api_base="https://aihubmix.com/v1"
14+
api_base="https://aihubmix.com/v1",
15+
is_chat_model=True
1516
)
1617

1718
# Settings.llm = OpenAI(

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ all-in-rag/
203203

204204
- 🚨 **Bug报告**:发现问题请提交 [Issue](https://github.com/datawhalechina/all-in-rag/issues)
205205
- 💭 **教程建议**:有好的想法欢迎在 [Discussions](https://github.com/datawhalechina/all-in-rag/discussions) 中讨论
206-
- 📚 **文档改进**:帮助完善文档内容和示例代码(当前仅支持第七章优质内容pr
206+
- 📚 **文档改进**:帮助完善文档内容和示例代码(当前仅支持 Extra-chapter 优质内容pr
207207

208208
## Star History
209209

docs/chapter1/03_get_start_rag.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,17 @@ import os
219219
# os.environ['HF_ENDPOINT']='https://hf-mirror.com'
220220
from dotenv import load_dotenv
221221
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
222-
from llama_index.llms.openai import OpenAI
222+
from llama_index.llms.openai_like import OpenAILike
223223
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
224224

225225
load_dotenv()
226226

227-
Settings.llm = OpenAI(model="glm-4.7-flash-free", api_key=os.getenv("DEEPSEEK_API_KEY"), api_base="https://aihubmix.com/v1")
227+
Settings.llm = OpenAILike(
228+
model="glm-4.7-flash-free",
229+
api_key=os.getenv("DEEPSEEK_API_KEY"),
230+
api_base="https://aihubmix.com/v1",
231+
is_chat_model=True
232+
)
228233
Settings.embed_model = HuggingFaceEmbedding("BAAI/bge-small-zh-v1.5")
229234

230235
documents = SimpleDirectoryReader(input_files=["../../data/C1/markdown/easy-rl-chapter1.md"]).load_data()

0 commit comments

Comments
 (0)