Spaces:
Running
Running
sachin
commited on
Commit
·
bb74941
1
Parent(s):
a6b6e79
process-selected rows
Browse files- taxtech/views.py +10 -12
taxtech/views.py
CHANGED
@@ -77,16 +77,14 @@ def recipe_generate_route(request):
|
|
77 |
class TaxLLMView(APIView):
|
78 |
def post(self, request, format=None):
|
79 |
try:
|
80 |
-
response = requests.get('http://gaganyatri-django-spaces.hf.space/taxtech/taxdata/company/')
|
81 |
-
if response.status_code == 200:
|
82 |
-
api_data = response.json()
|
83 |
-
|
84 |
data = request.data
|
|
|
|
|
|
|
85 |
isOnline = True
|
86 |
prompt = f"Hier sind weitere Daten: {api_data}. Bitte beantworten Sie die folgende Frage: {data['messages'][0]['prompt']}"
|
87 |
model = data['model']
|
88 |
-
|
89 |
-
|
90 |
messages = [
|
91 |
{
|
92 |
"role": "system",
|
@@ -111,7 +109,7 @@ class TaxLLMView(APIView):
|
|
111 |
else:
|
112 |
content = "helloWorld"
|
113 |
|
114 |
-
print(content)
|
115 |
return Response({"response": content})
|
116 |
except Exception as e:
|
117 |
print(f"An error occurred: {e}")
|
@@ -120,15 +118,15 @@ class TaxLLMView(APIView):
|
|
120 |
class TaxLLMTaxAddView(APIView):
|
121 |
def post(self, request, format=None):
|
122 |
try:
|
123 |
-
|
124 |
-
if response.status_code == 200:
|
125 |
-
api_data = response.json()
|
126 |
|
|
|
|
|
127 |
data = request.data
|
128 |
isOnline = True
|
129 |
prompt = f"Hier sind weitere Daten: {api_data}. Bitte beantworten Sie die folgende Frage: {data['messages'][0]['prompt']}"
|
130 |
model = data['model']
|
131 |
-
print(model)
|
132 |
|
133 |
messages = [
|
134 |
{
|
@@ -154,7 +152,7 @@ class TaxLLMTaxAddView(APIView):
|
|
154 |
else:
|
155 |
content = "helloWorld"
|
156 |
|
157 |
-
print(content)
|
158 |
return Response({"response": content})
|
159 |
except Exception as e:
|
160 |
print(f"An error occurred: {e}")
|
|
|
77 |
class TaxLLMView(APIView):
|
78 |
def post(self, request, format=None):
|
79 |
try:
|
|
|
|
|
|
|
|
|
80 |
data = request.data
|
81 |
+
|
82 |
+
api_data = data['selectedRows']
|
83 |
+
|
84 |
isOnline = True
|
85 |
prompt = f"Hier sind weitere Daten: {api_data}. Bitte beantworten Sie die folgende Frage: {data['messages'][0]['prompt']}"
|
86 |
model = data['model']
|
87 |
+
|
|
|
88 |
messages = [
|
89 |
{
|
90 |
"role": "system",
|
|
|
109 |
else:
|
110 |
content = "helloWorld"
|
111 |
|
112 |
+
#print(content)
|
113 |
return Response({"response": content})
|
114 |
except Exception as e:
|
115 |
print(f"An error occurred: {e}")
|
|
|
118 |
class TaxLLMTaxAddView(APIView):
|
119 |
def post(self, request, format=None):
|
120 |
try:
|
121 |
+
data = request.data
|
|
|
|
|
122 |
|
123 |
+
api_data = data['selectedRows']
|
124 |
+
|
125 |
data = request.data
|
126 |
isOnline = True
|
127 |
prompt = f"Hier sind weitere Daten: {api_data}. Bitte beantworten Sie die folgende Frage: {data['messages'][0]['prompt']}"
|
128 |
model = data['model']
|
129 |
+
# print(model)
|
130 |
|
131 |
messages = [
|
132 |
{
|
|
|
152 |
else:
|
153 |
content = "helloWorld"
|
154 |
|
155 |
+
# print(content)
|
156 |
return Response({"response": content})
|
157 |
except Exception as e:
|
158 |
print(f"An error occurred: {e}")
|