Skip to content

Commit

Permalink
fix import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
alebjanes committed Apr 3, 2024
1 parent 27fffef commit c5cf246
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ To add all the cubes of a project automatically, they can be mapped from the tes

On local development, you can run the following code:
```
uvicorn src.main:app --reload
uvicorn main:app --reload
```
## How to build the docker image
```
Expand Down
6 changes: 6 additions & 0 deletions api/src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
<<<<<<< Updated upstream
from utils.app import get_api
=======
from langchain_core.runnables import RunnableLambda, chain
from app import get_api
from config import TABLES_PATH
>>>>>>> Stashed changes
from wrapper.lanbot import Langbot
from langchain_core.runnables import RunnableLambda, chain
import time
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions api/src/utils/api_data_request/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
import pandas as pd

from config import MONDRIAN_API, TESSERACT_API
<<<<<<< Updated upstream:api/src/utils/api_data_request/api.py
from utils.table_selection.table_details import *
from utils.preprocessors.text import *
from utils.api_data_request.similarity_search import *
=======
from table_selection.table import *
from utils.preprocessors.text import *
from utils.similarity_search import *
>>>>>>> Stashed changes:api/src/api_data_request/api.py

class ApiBuilder:

Expand Down Expand Up @@ -86,6 +92,9 @@ def fetch_data(self):

except Exception as e:
return {}, pd.DataFrame(), f"An error occurred: {str(e)}"

def build_json(self):
return

def __str__(self):
return self.build_url()
Expand Down
7 changes: 7 additions & 0 deletions api/src/utils/api_data_request/api_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
import time

from config import OLLAMA_API
<<<<<<< Updated upstream:api/src/utils/api_data_request/api_generator.py
from utils.table_selection.table_details import *
from utils.preprocessors.text import *
from utils.api_data_request.similarity_search import *
from utils.api_data_request.api import *
=======
from table_selection.table import *
from utils.preprocessors.text import *
from utils.similarity_search import *
from api_data_request.api import *
>>>>>>> Stashed changes:api/src/api_data_request/api_generator.py

def get_api_components_messages(table, model_author, natural_language_query = ""):

Expand Down
7 changes: 7 additions & 0 deletions api/src/utils/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

from os import getenv

<<<<<<< Updated upstream:api/src/utils/app.py
from utils.table_selection.table_selector import *
from utils.table_selection.table_details import *
from utils.api_data_request.api_generator import *
from utils.data_analysis.data_analysis import *
=======
from table_selection.table_selector import *
from table_selection.table import *
from api_data_request.api_generator import *
from data_analysis.data_analysis import *
>>>>>>> Stashed changes:api/src/app.py
from utils.logs import *

def get_api(query, TABLES_PATH):
Expand Down
4 changes: 4 additions & 0 deletions api/src/utils/data_analysis/data_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
from langchain_experimental.agents import create_pandas_dataframe_agent
from langchain_community.chat_models import ChatOpenAI

<<<<<<< Updated upstream:api/src/utils/data_analysis/data_analysis.py
=======
from config import OPENAI_KEY
>>>>>>> Stashed changes:api/src/data_analysis/data_analysis.py

def agent_answer(df, natural_language_query):

Expand Down
5 changes: 5 additions & 0 deletions api/src/utils/helpers/cube_to_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from config import POSTGRES_ENGINE
from sentence_transformers import SentenceTransformer

<<<<<<< Updated upstream
def embedding(dataframe, column):
"""
Creates embeddings for text in the passed column
Expand All @@ -13,6 +14,10 @@ def embedding(dataframe, column):
dataframe['embedding'] = model_embeddings.tolist()

return dataframe
=======
from config import POSTGRES_ENGINE
from utils.similarity_search import embedding
>>>>>>> Stashed changes


def create_table():
Expand Down
5 changes: 5 additions & 0 deletions api/src/utils/helpers/drilldowns_to_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from config import POSTGRES_ENGINE
from sentence_transformers import SentenceTransformer

<<<<<<< Updated upstream
def embedding(dataframe, column):
"""
Creates embeddings for text in the passed column
Expand All @@ -15,6 +16,10 @@ def embedding(dataframe, column):
dataframe['embedding'] = model_embeddings.tolist()

return dataframe
=======
from config import POSTGRES_ENGINE
from utils.similarity_search import embedding
>>>>>>> Stashed changes


def create_table():
Expand Down
5 changes: 5 additions & 0 deletions api/src/utils/table_selection/table_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
from typing import List
from sentence_transformers import SentenceTransformer

<<<<<<< Updated upstream:api/src/utils/table_selection/table_selector.py
from utils.table_selection.table_details import *
from utils.table_selection.table_database_search import get_similar_tables
=======
from table_selection.table import *
from utils.similarity_search import get_similar_tables
>>>>>>> Stashed changes:api/src/table_selection/table_selector.py
from utils.few_shot_examples import get_few_shot_example_messages
from utils.preprocessors.text import extract_text_from_markdown_triple_backticks

Expand Down

0 comments on commit c5cf246

Please sign in to comment.