feat: upgraded rag model from ollama to chatgpt#256
Open
yk-chenyang wants to merge 3 commits intopingcap:mainfrom
Open
feat: upgraded rag model from ollama to chatgpt#256yk-chenyang wants to merge 3 commits intopingcap:mainfrom
yk-chenyang wants to merge 3 commits intopingcap:mainfrom
Conversation
Mini256
reviewed
Dec 23, 2025
Member
Mini256
left a comment
There was a problem hiding this comment.
Please do not replace the existing example, add a new exmaple instead. For example: examples/chatbot_with_rag.
examples/rag/src/models.py
Outdated
| text: str = Field(sa_type=Text) | ||
|
|
||
| # table user_chart stores info of users | ||
| class Users(TableModel, table=True): |
Member
There was a problem hiding this comment.
Suggested change
| class Users(TableModel, table=True): | |
| class User(TableModel, table=True): |
Table Model class names can use singular forms.
examples/rag/src/models.py
Outdated
| document_name: str = Field(sa_type=Text) | ||
|
|
||
| # table chat_history that stores the references to chat sessions of all users. Each row stores info of a session that chat_message represents | ||
| class ChatHistory(TableModel, table=True): |
Member
There was a problem hiding this comment.
Suggested change
| class ChatHistory(TableModel, table=True): | |
| class Chat(TableModel, table=True): |
ChatHistory -> Chat Would be better?
examples/rag/src/utils.py
Outdated
Comment on lines
39
to
40
| ch_table = db.create_table(schema=ChatHistory, if_exists='skip') | ||
| cm_table = db.create_table(schema=ChatMessage, if_exists='skip') |
Member
There was a problem hiding this comment.
Suggested change
| ch_table = db.create_table(schema=ChatHistory, if_exists='skip') | |
| cm_table = db.create_table(schema=ChatMessage, if_exists='skip') | |
| chat_table = db.create_table(schema=ChatHistory, if_exists='skip') | |
| message_table = db.create_table(schema=ChatMessage, if_exists='skip') |
Mini256
reviewed
Dec 23, 2025
Member
There was a problem hiding this comment.
Avoid commit .DS_Store to git repo
Mini256
reviewed
Dec 23, 2025
examples/rag/README.md
Outdated
| "model": "gemma3:4b", | ||
| "prompt": "Hello, Who are you?" | ||
| }' | ||
| git clone https://github.com/cindywxw1/Intramind.git |
Member
There was a problem hiding this comment.
Suggested change
| git clone https://github.com/cindywxw1/Intramind.git | |
| git clone https://github.com/pingcap/pytidb.git | |
| cd examples/chatbot_with_rag |
examples/rag/README.md
Outdated
| @@ -1,89 +1,66 @@ | |||
| # RAG Example | |||
| # Intramind | |||
Member
There was a problem hiding this comment.
Suggested change
| # Intramind | |
| # Chatbot with RAG |
using a general name would be better.
Author
|
@Mini256 Thank you for your comments! I've updated commits accordingly. Please check again to see if this can be finalized, and I'll be here if there're any further modifications to be made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under guidance of Mr. Hao Huo (@github.com/sykp241095), Cindy Wang (@github.com/cindywxw1) and I built an RAG-driven AI Chatbot that used OpenAI's LLM models. We would love to contribute to PingCAP's amazing community, so we would like to update the RAG example in PyTiDB's repo with our new OpenAI models. Hope everyone will enjoy this new example and get to enjoy the capability of PyTiDB!