Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import random
|
|
| 7 |
import openai
|
| 8 |
import re
|
| 9 |
import gradio as gr
|
| 10 |
-
|
| 11 |
"""# Space Implementation"""
|
| 12 |
|
| 13 |
clerkieExamples=["how do I use langchain?", "How do I create an agent with custom LLMChain?"]
|
|
@@ -15,7 +15,7 @@ clerkieExamples=["how do I use langchain?", "How do I create an agent with custo
|
|
| 15 |
def chat(message, history):
|
| 16 |
print(message)
|
| 17 |
history = history or []
|
| 18 |
-
endpoint =
|
| 19 |
response = requests.get(endpoint + message).json()["response"]["output"]
|
| 20 |
# split on code
|
| 21 |
split_string = response.split("Code")
|
|
|
|
| 7 |
import openai
|
| 8 |
import re
|
| 9 |
import gradio as gr
|
| 10 |
+
import os
|
| 11 |
"""# Space Implementation"""
|
| 12 |
|
| 13 |
clerkieExamples=["how do I use langchain?", "How do I create an agent with custom LLMChain?"]
|
|
|
|
| 15 |
def chat(message, history):
|
| 16 |
print(message)
|
| 17 |
history = history or []
|
| 18 |
+
endpoint = os.environ.get("langchain_bot_api_endpoint")
|
| 19 |
response = requests.get(endpoint + message).json()["response"]["output"]
|
| 20 |
# split on code
|
| 21 |
split_string = response.split("Code")
|