LONGYKING commited on
Commit
f53da68
·
1 Parent(s): 2fddb4d

added google auth

Browse files
Files changed (5) hide show
  1. .dockerignore +98 -0
  2. Dockerfile +18 -0
  3. Procfile +1 -0
  4. chatxbt-assistant.py +12 -0
  5. src/libs/helper_functions.py +1 -0
.dockerignore ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Jupyter Notebook
53
+ .ipynb_checkpoints
54
+
55
+ # pyenv
56
+ .python-version
57
+
58
+ # pipenv
59
+ .venv
60
+
61
+ # Environments
62
+ #.env
63
+ .venv/
64
+ env/
65
+ venv/
66
+ ENV/
67
+ env.bak/
68
+ venv.bak/
69
+
70
+ # Spyder project settings
71
+ .spyderproject
72
+ .spyproject
73
+
74
+ # Rope project settings
75
+ .ropeproject
76
+
77
+ # mkdocs documentation
78
+ /site
79
+
80
+ # mypy
81
+ .mypy_cache/
82
+ .dmypy.json
83
+ dmypy.json
84
+
85
+ # Pyre type checker
86
+ .pyre/
87
+
88
+ # Ignore virtual environments
89
+ venv/
90
+ .venv/
91
+
92
+ # Ignore Dockerfile and docker-compose.yml if not needed in the image
93
+ Dockerfile
94
+ docker-compose.yml
95
+
96
+ # Ignore temporary files
97
+ *.log
98
+ *.tmp
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
9
+
10
+ # Install any needed packages specified in requirements.txt
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Make port 8501 available to the world outside this container
14
+ EXPOSE 8000
15
+
16
+ # Run chainlit when the container launches
17
+ CMD ["chainlit", "run", "chatxbt-assistant.py"]
18
+
Procfile ADDED
@@ -0,0 +1 @@
 
 
1
+ web: docker run -p $PORT:8000 chatxbt-assistant
chatxbt-assistant.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  from dotenv import load_dotenv
3
  load_dotenv()
4
 
@@ -22,6 +23,17 @@ from src.tools.coin_data_toolkit import CryptoDataTools
22
  # f_assistant.print_response("What is the stock price of NVDA")
23
  # f_assistant.print_response("Write a comparison between NVDA and AMD, use all tools available.")
24
 
 
 
 
 
 
 
 
 
 
 
 
25
  @cl.set_starters
26
  async def set_starters():
27
  return [
 
1
  import os
2
+ from typing import Optional, Dict
3
  from dotenv import load_dotenv
4
  load_dotenv()
5
 
 
23
  # f_assistant.print_response("What is the stock price of NVDA")
24
  # f_assistant.print_response("Write a comparison between NVDA and AMD, use all tools available.")
25
 
26
+
27
+ @cl.oauth_callback
28
+ def oauth_callback(
29
+ provider_id: str,
30
+ token: str,
31
+ raw_user_data: Dict[str, str],
32
+ default_user: cl.User,
33
+ ) -> Optional[cl.User]:
34
+ return default_user
35
+
36
+
37
  @cl.set_starters
38
  async def set_starters():
39
  return [
src/libs/helper_functions.py CHANGED
@@ -3,6 +3,7 @@ import uuid
3
  import hashlib
4
  from ulid import ULID
5
 
 
6
  def chunk_data(data : list | dict, chunk_size: int):
7
  """
8
  This function takes an array and a chunk size as input, and returns a new array
 
3
  import hashlib
4
  from ulid import ULID
5
 
6
+
7
  def chunk_data(data : list | dict, chunk_size: int):
8
  """
9
  This function takes an array and a chunk size as input, and returns a new array