Skip to content

Commit

Permalink
fix:merge rag_sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-ckt committed Jan 2, 2024
2 parents c1e660b + 7ad668c commit 6ffb9e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ setup: ## Set up the Python development environment
$(VENV_BIN)/pip install -r requirements/lint-requirements.txt

testenv: setup ## Set up the Python test environment
$(VENV_BIN)/pip install -e ".[simple_framework]"
$(VENV_BIN)/pip install -e ".[default]"

.PHONY: fmt
fmt: setup ## Format Python code
Expand Down
6 changes: 3 additions & 3 deletions dbgpt/datasource/rdbms/conn_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_indexes(self, table_name: str) -> List[Dict]:
"""
session = self.client

_query_sql = f"""
_query_sql = f"""
SELECT name AS table, primary_key, from system.tables where database ='{self.client.database}' and table = '{table_name}'
"""
with session.query_row_block_stream(_query_sql) as stream:
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_fields(self, table_name):
"""Get column fields about specified table."""
session = self.client

_query_sql = f"""
_query_sql = f"""
SELECT name, type, default_expression, is_in_primary_key, comment from system.columns where table='{table_name}'
""".format(
table_name
Expand Down Expand Up @@ -275,7 +275,7 @@ def table_simple_info(self):

_sql = f"""
SELECT concat(TABLE_NAME, '(', arrayStringConcat(groupArray(column_name), '-'), ')') AS schema_info
FROM information_schema.COLUMNS
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = '{self.get_current_db_name()}'
GROUP BY TABLE_NAME
"""
Expand Down
20 changes: 10 additions & 10 deletions dbgpt/serve/rag/assembler/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@

class EmbeddingAssembler(BaseAssembler):
"""Embedding Assembler
Example:
.. code-block:: python
from dbgpt.rag.assembler import EmbeddingAssembler
.. code-block:: python
from dbgpt.rag.assembler import EmbeddingAssembler
pdf_path = "path/to/document.pdf"
knowledge = KnowledgeFactory.from_file_path(pdf_path)
assembler = EmbeddingAssembler.load_from_knowledge(
knowledge=knowledge, embedding_model="text2vec"
)
assembler.persist()
# get db struct retriever
retriever = assembler.as_retriever(top_k=3)
pdf_path = "path/to/document.pdf"
knowledge = KnowledgeFactory.from_file_path(pdf_path)
assembler = EmbeddingAssembler.load_from_knowledge(
knowledge=knowledge,
embedding_model="text2vec",
)
"""

def __init__(
Expand Down

0 comments on commit 6ffb9e5

Please sign in to comment.