Skip to content

Commit

Permalink
Merge pull request #59 from Qredence/small-update-streamlit
Browse files Browse the repository at this point in the history
Small update streamlit
  • Loading branch information
Zochory authored Sep 1, 2024
2 parents 8592ef2 + 58f8ffc commit bba6684
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 198 deletions.
126 changes: 0 additions & 126 deletions .github/workflows/graphfleet.stainless.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/javascript-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [main]

env:
NODE_VERSION: 18.x
NODE_VERSION: 20.x

jobs:
javascript-ci:
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/openapi_stainless.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/semver.yml

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.5
36 changes: 7 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,16 @@ export GRAPHRAG_EMBEDDING_ENDPOINT="<https://your-azure-openai-embedding-resourc
export GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME="your_embedding_deployment_name"
```

settings.yaml: Customize GraphFleet's behavior further by modifying the settings.yaml file within the graphfleet directory.

1. Data Indexing:
Jupyter Notebook Guide: Follow the instructions provided in the get-started-graphfleet.ipynb notebook to learn how to index your data with GraphFleet. This notebook provides a hands-on experience for setting up your knowledge base.
settings.yaml: Customize GraphFleet's behavior further by modifying the settings.yaml file within the graphfleet directory.

1. Interacting with GraphFleet:
Jupyter Notebooks: Explore GraphFleet's capabilities with the provided notebooks:

get-started-graphfleet.ipynb: A comprehensive guide to indexing your data and running basic queries.

1. Interacting with GraphFleet:
settings.yaml: Customize GraphFleet's behavior further by modifying the settings.yaml file within the graphfleet directory.
Jupyter Notebooks: Explore GraphFleet's capabilities with the provided notebooks:
get-started-graphfleet.ipynb: A comprehensive guide to indexing your data and running basic queries.
Local Search Notebook.ipynb: Demonstrates local search techniques.

app.py (FastAPI Application): Run a Streamlit-powered web interface to interact with GraphFleet using a user-friendly chat-like interface.

### Add your text files in ./graphfleet/input/ and run the auto_prompt function
Expand All @@ -119,9 +117,7 @@ Jupyter Notebooks: Explore GraphFleet's capabilities with the provided notebooks
--output ./graphfleet/prompts
```



### Data Indexing:
### Data Indexing

Jupyter Notebook Guide: Follow the instructions provided in the get-started-graphfleet.ipynb notebook to learn how to index your data with GraphFleet. This notebook provides a hands-on experience for setting up your knowledge base.

Expand All @@ -132,8 +128,8 @@ Jupyter Notebook Guide: Follow the instructions provided in the get-started-grap
--config ./graphfleet/settings.yaml
```

### Recommended Run these notebook to get started with GraphFleet

## Recommanded : Run these notebook to get started with GraphFleet:
Jupyter Notebooks: Explore GraphFleet's capabilities with the provided notebooks:

([Get Started Quickly.ipynb](https://github.com/Qredence/GraphFleet/blob/a67eaeb295d99dd2ef48bcdd8f8a719b830ffb7d/notebook/Get%20Started%20Quickly.ipynb)): A comprehensive guide to indexing your data and running basic queries.
Expand All @@ -159,24 +155,6 @@ streamlit run app/streamlit_app.py
```


### CLI Command:

#### Run the CLI commands to query the graph
``` bash
! python -m graphrag.query \
--root ./graphfleet \
--method global \
--streaming \ #stream the response
"Language Agent Tree Search?"
```

``` bash
! python -m graphrag.query \
--root ./graphfleet \
--method global \
--streaming \ #stream the response
"What are the key features of GraphRAG ??"
```

## Security

Expand Down
3 changes: 3 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ RUN git clone https://github.com/Qredence/GraphFleet.git .

RUN pip3 install -r requirements.txt

# Install python-dotenv
RUN pip3 install python-dotenv

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
Expand Down
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class Settings(BaseSettings):
API_KEY: str = os.getenv("GRAPHRAG_API_KEY", "default_api_key")
LLM_MODEL: str = os.getenv("GRAPHRAG_LLM_MODEL", "gpt-4o-mini")
LLM_MODEL: str = os.getenv("GRAPHRAG_LLM_MODEL", "default_llm_model")
EMBEDDING_MODEL: str = os.getenv("GRAPHRAG_EMBEDDING_MODEL", "text-embedding-3-large")
API_BASE: str = os.getenv("GRAPHRAG_API_BASE", "default_api_base")
API_VERSION: str = os.getenv("GRAPHRAG_API_VERSION", "default_api_version")
Expand Down
13 changes: 9 additions & 4 deletions app/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from config import settings, Settings

# Define the API base URL
API_BASE_URL = "http://localhost:8000" # Adjust this if your API is hosted elsewhere
# Define the API base URL Adjust this if your API is hosted elsewhere
API_BASE_URL = "http://localhost:8000"

st.title("GraphFleet Search App")

Expand Down Expand Up @@ -149,5 +149,10 @@ def is_default_value(value):
return value.startswith("default_") or value == "Not set"
return False

if any(is_default_value(value) for value in settings_dict.values()):
st.warning("Some settings are using default values. Please update them for full functionality.")
# Move this check before displaying the settings
if any(is_default_value(value) for value in settings_dict.values()):
st.warning("Some settings are using default values. Please update them for full functionality.")

# Display current settings
st.subheader("Current Settings")
st.json(settings_dict)
11 changes: 11 additions & 0 deletions graphfleet/utils/env_vars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pydantic import BaseSettings


class EnvVars(BaseSettings):
OPENAI_API_KEY: str
GOOGLE_API_KEY: str
GOOGLE_CSE_ID: str

class Config:
env_file = ".env"
env_file_encoding = "utf-8"
Loading

0 comments on commit bba6684

Please sign in to comment.