Skip to content

Commit

Permalink
example: update README(#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
sykp241095 authored Apr 17, 2024
1 parent a8b7247 commit 1167533
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ Please make sure you have created a TiDB Serverless cluster with vector support

- [OpenAI Embedding](./openai_embedding/README.md): use the OpenAI embedding model to generate vectors for text data.
- [Image Search](./image_search/README.md): use the OpenAI CLIP model to generate vectors for image and text.
- [LlamaIndex RAG](./llamaindex-tidb-vector-with-ui/README.md): use the LlamaIndex to build an [RAG(Retrieval-Augmented Generation)](https://docs.llamaindex.ai/en/latest/getting_started/concepts/) application.
- [LlamaIndex RAG with UI](./llamaindex-tidb-vector-with-ui/README.md): use the LlamaIndex to build an [RAG(Retrieval-Augmented Generation)](https://docs.llamaindex.ai/en/latest/getting_started/concepts/) application.
- [Chat with URL](./llamaindex-tidb-vector/README.md): use LlamaIndex to build an [RAG(Retrieval-Augmented Generation)](https://docs.llamaindex.ai/en/latest/getting_started/concepts/) application that can chat with a URL.

## Real World Applications

### tidb.ai

[tidb.ai](https://tidb.ai) is an amazing out-of-the-box RAG(Retrieval Augmented Generation) template project based on the TiDB Vector store, it contains ui and server logic, fork it on [github](https://github.com/pingcap/tidb.ai) and build your own application.

![out-of-box-conversational-search](https://github.com/pingcap/tidb.ai/assets/1237528/0784e26e-8392-4bbe-bda1-6a680b12a805 "Image Title")
6 changes: 3 additions & 3 deletions examples/llamaindex-tidb-vector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export TIDB_PASSWORD="****"
### Run this example

```text
$ python talk_to_url.py --help
Usage: talk_to_url.py [OPTIONS]
$ python chat_with_url.py --help
Usage: chat_with_url.py [OPTIONS]
Options:
--url TEXT URL you want to talk to,
default=https://docs.pingcap.com/tidb/stable/overview
--help Show this message and exit.
$
$ python talk_to_url.py
$ python chat_with_url.py
Enter your question: : tidb vs mysql
TiDB is an open-source distributed SQL database that supports Hybrid Transactional and Analytical Processing (HTAP) workloads. It is MySQL compatible and features horizontal scalability, strong consistency, and high availability. TiDB is designed to provide users with a one-stop database solution that covers OLTP, OLAP, and HTAP services. It offers easy horizontal scaling, financial-grade high availability, real-time HTAP capabilities, cloud-native features, and compatibility with the MySQL protocol and ecosystem.
Enter your question: :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def do_prepare_data(url):
@click.command()
@click.option('--url',default=_default_url,
help=f'URL you want to talk to, default={_default_url}')
def talk_to(url):
def chat_with_url(url):
do_prepare_data(url)
while True:
question = click.prompt("Enter your question: ")
response = query_engine.query(question)
click.echo(response)

if __name__ == '__main__':
talk_to()
chat_with_url()

0 comments on commit 1167533

Please sign in to comment.