File tree 2 files changed +3
-18
lines changed
2 files changed +3
-18
lines changed Original file line number Diff line number Diff line change 12
12
from slack_bolt import App
13
13
from slack_bolt .adapter .socket_mode import SocketModeHandler
14
14
15
+ import app
15
16
from app import query
16
- from app .config import (
17
- DB_CONNECTION_STRING ,
18
- OPENAI_API_KEY ,
19
- SLACK_APP_TOKEN ,
20
- SLACK_BOT_TOKEN ,
21
- )
22
17
23
18
24
19
def get_secret (secret_name ):
@@ -59,17 +54,6 @@ def run(self):
59
54
SocketModeHandler (self .slack_app , get_secret ("SLACK_APP_TOKEN" )).start ()
60
55
61
56
62
- ray .init (
63
- runtime_env = {
64
- "env_vars" : {
65
- "DB_CONNECTION_STRING" : get_secret ("DB_CONNECTION_STRING" ),
66
- "OPENAI_API_KEY" : OPENAI_API_KEY ,
67
- }
68
- },
69
- ignore_reinit_error = True ,
70
- )
71
-
72
-
73
57
class Query (BaseModel ):
74
58
query : str
75
59
@@ -84,6 +68,7 @@ class Answer(BaseModel):
84
68
@serve .ingress (app )
85
69
class RayAssistantDeployment :
86
70
def __init__ (self ):
71
+ app .config .DB_CONNECTION_STRING = get_secret ("DB_CONNECTION_STRING" )
87
72
self .agent = query .QueryAgent (
88
73
llm = "meta-llama/Llama-2-70b-chat-hf" ,
89
74
max_context_length = 4096 ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ cluster_env: ray-assistant:2
3
3
ray_serve_config :
4
4
import_path : app.serve:deployment
5
5
runtime_env :
6
- working_dir : " https://github.com/ray-project/llm-applications/archive/refs/tags/v0.0.3 .zip"
6
+ working_dir : " https://github.com/ray-project/llm-applications/archive/refs/tags/v0.0.4 .zip"
7
7
env_vars : {
8
8
RAY_ASSISTANT_AWS_SECRET_ID : " ray-assistant" ,
9
9
RAY_ASSISTANT_AWS_REGION : " us-west-2"
You can’t perform that action at this time.
0 commit comments