DB-GPT icon indicating copy to clipboard operation
DB-GPT copied to clipboard

add cubejs as a datasource

Open lordk911 opened this issue 10 months ago • 5 comments

Description

https://python.langchain.com/docs/integrations/document_loaders/cube_semantic/

Cube’s data model provides structure and definitions that are used as a context for LLM to understand data and generate correct queries. LLM doesn’t need to navigate complex joins and metrics calculations because Cube abstracts those and provides a simple interface that operates on the business-level terminology, instead of SQL table and column names. This simplification helps LLM to be less error-prone and avoid hallucinations.

How Has This Been Tested?

image

image

lordk911 avatar Apr 25 '24 09:04 lordk911

hi, @lordk911 Thank you very much for your contribution, cubejs is a great feature, could you fix some mypy error just make mypy

Aries-ckt avatar Apr 25 '24 11:04 Aries-ckt

hi, @lordk911 Thank you very much for your contribution, cubejs is a great feature, could you fix some mypy error just make mypy

I've done make mypy , only one error left :

dbgpt/datasource/rdbms/conn_cubejs.py:8: error: Cannot find implementation or library stub for module named "jwt" [import-not-found]

Is this need to care about? pyjwt is required-by: zhipuai

lordk911 avatar Apr 25 '24 14:04 lordk911

hi, there are some conflicts, could you fix that? and could you give some example how to mock cubejs data?

Aries-ckt avatar Apr 26 '24 01:04 Aries-ckt

and could you give some example how to mock cubejs data?

please flow this quick start docment, we can use the sample database

image

in DB-GPT create a cubejs connection:

image

current I use the remark value to config cubejs restapi infomation,for example: {"CUBE_API_URL":"http://10.9.27.29:4000/cubejs-api/v1","CUBE_API_SECRET":"399f4816ea860e0d5676154441860b7f"}

in CUBEJS_DEV_MODE we didn't use authentication so Username Password and CUBE_API_SECRET could be any , also DB Name could be any

lordk911 avatar Apr 26 '24 02:04 lordk911

ok, we will have a quick test and put cubejs datasource feature in v0.5.6 version.

Aries-ckt avatar Apr 26 '24 02:04 Aries-ckt