Th3Nic3Guy commited on
Commit
e962bef
·
1 Parent(s): 73b37a4

updating code

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -14,10 +14,10 @@ load_dotenv()
14
 
15
  BASE_API_URL = "https://api.langflow.astra.datastax.com"
16
  LANGFLOW_ID = "e99b525a-84dd-4cf2-bac6-8e5ebc6a7d17"
17
- FLOW_ID = "bfbf7237-50dd-40dd-baba-cc680288d788"
18
  DATASTAX_TOKEN = os.getenv('DATASTAX_TOKEN')
19
 
20
- ENDPOINT = 'ai_traveller'
21
 
22
  TWEAKS = {
23
  "Memory-fCuCs": {
@@ -35,7 +35,7 @@ TWEAKS = {
35
 
36
 
37
  @retry((ConnectTimeout, ReadTimeout), tries=3, delay=2)
38
- def call_travel_ai(
39
  message: str,
40
  history: Sequence[Tuple[str, str]],
41
  local_storage: str,
@@ -77,7 +77,7 @@ def call_travel_ai(
77
  headers=headers,
78
  timeout=120,
79
  )
80
- print(response.content)
81
  response = response.json()
82
  resp_message = ''
83
  try:
@@ -114,9 +114,9 @@ with gr.Blocks() as demo:
114
  'Chat With Agent',
115
  ) as chat:
116
  chat_interface = gr.ChatInterface(
117
- call_travel_ai,
118
  type='messages',
119
- title="AI Travel Partner",
120
  additional_inputs=[session],
121
  autofocus=True,
122
  fill_height=True,
 
14
 
15
  BASE_API_URL = "https://api.langflow.astra.datastax.com"
16
  LANGFLOW_ID = "e99b525a-84dd-4cf2-bac6-8e5ebc6a7d17"
17
+ FLOW_ID = "fa9291fe-1ddd-4503-b438-f090dd76994d"
18
  DATASTAX_TOKEN = os.getenv('DATASTAX_TOKEN')
19
 
20
+ ENDPOINT = 'beauty_advisor'
21
 
22
  TWEAKS = {
23
  "Memory-fCuCs": {
 
35
 
36
 
37
  @retry((ConnectTimeout, ReadTimeout), tries=3, delay=2)
38
+ def call_ai(
39
  message: str,
40
  history: Sequence[Tuple[str, str]],
41
  local_storage: str,
 
77
  headers=headers,
78
  timeout=120,
79
  )
80
+ print(response, response.content)
81
  response = response.json()
82
  resp_message = ''
83
  try:
 
114
  'Chat With Agent',
115
  ) as chat:
116
  chat_interface = gr.ChatInterface(
117
+ call_ai,
118
  type='messages',
119
+ title="AI Beauty Partner",
120
  additional_inputs=[session],
121
  autofocus=True,
122
  fill_height=True,