Spaces:
Runtime error
Runtime error
amirshafiei
commited on
Commit
•
770381c
1
Parent(s):
3158ec0
Add app file
Browse files- api_call.py +12 -13
- requirements.txt +4 -1
- state_handler.py +1 -1
api_call.py
CHANGED
@@ -4,9 +4,8 @@ import requests
|
|
4 |
import requests
|
5 |
import urllib.parse
|
6 |
import json
|
7 |
-
from easydict import EasyDict as edict
|
8 |
from fastapi import FastAPI, File, UploadFile, Form
|
9 |
-
from Zillow_Scraper.selenium_wrapper import search
|
10 |
|
11 |
API_token = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1eG42aWVkcXlwMmtzbGVnZms2N3pmN3kyN2MzMTBsaSIsImlzcyI6ImRhdGFmaW5pdGkuY28ifQ.fwFM5-Z5ZMPwqbRuiyQhcQP9NjMqP-sm-EZ7W3BA2NnfqN6p0_Kapz6pr2tMGlZ7ranZ1DVb_gScmtPm8R_F6JpJ5dKNL7rZamUwR84TzxNPzOAns7UgjMSx-5p-7f9U2_NGg3ORveaQTfs1-QH9uiDw4v6U91lhD4rReXVgom5qhNlSbmHkj81DHVHaX969hPDtdEiQ5tspib3xgwWDyXYQYGcwPFoLIHET9srNP7zKWyghbiwh90DTnj3ASmYFO3Nrj8zdfXmkCkUXa1vwEf69qKD8T2L8-OsZlMn-t8X7uYyi_pFP4v78N_6SgfX1t8csRUqlymkFX-gVnqeDsPivSXvQrz9Su68g2HlMyOrutpdc7i6z3OCy8zt3HET_LMw4ccKHYeNxHJLf572ALRHvLVxWJTtEVPyqZ_IXHSHdhpk5jGvxSaW_T9ufmmeNfuLdDnOm_T1VhnXMI6-iAYDsWidSSzhQkrle8XcptRbyRyilMzU37BCd4klUiuVoMNJrBhIQEM9vgDEH8BfJHHOha3dCxWj0pKzlv4SHXokTlBVNDWg_vZFobylTOzsi0055PgenV-qiACzZpbFylTP0egdVKrxxfuOYe8fhzi61cwoaZ9YUqOspYRGsm_wRCwc3daS8SEvaEl1tXoRTpKsxe5kI6u7AVubqmhhI1LA'
|
12 |
# eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1MzRmanRmdmZwNnplcmJldHEzcnpienExZ2l6b201dyIsImlzcyI6ImRhdGFmaW5pdGkuY28ifQ.CONEaG0VEABopROdGvMWy3sBv0X8dB2rAUhijXEKRdRgAbII-zbX6FIZsV7pZ72M5BbaREhjOi9eU-5NKpvhiWnU8cjlrx0AmHRNrIBrHmPvoFE9IFeIN1pYS9nOvU6CctQB6ZvmoEMpF_VYVKwkBkmUNmY1UPF6TdINkdWg9ym0pC1TIhch4WM5akuHwlJXirzbV07SRrijnQUT1DRpt7_igbwRSt8smFUWejFDJnbxAaMeqsLHo7Trb3FgkBLAEHDdA7CgG2HONsAvOEKnf7hwpp3_mfziZ_uYO369wbfxkYIn6WnMqHYjjC6viD0b5zZI-hjZgT-87CUetWj3Oqs_B37JzqiHm0rxRHxlfFP_IvpqS263tjdnMgSUmsETy62W_cXAuk_Wn45nGiPfM26HclcZxBieYuCOFNojdZE-1apMehtXAgN0JEN29y5JZGBoSPHPZQKfvfAGEHlh-Ty3yZRiiPaQ2m4BLilZN2bB_tA0c8s7RXeHWph_t_GH5xoLO0PB_fZa_RrUmg-Cc2wsjTr59rYH-uGWpfhE-7Qa1du1tZYE4PpRqTq7KysAZzfuAgkhpJzpXwDAnuEsRDSGdhbteKnRIKajiEw8jt9KW0OnXEDOxx_cU9YrPmDvJIdvQjKKYz1Tuptce7ZmxXaHYoOtzN1I1aKpGQe1UJw
|
@@ -41,18 +40,18 @@ def send_request (budget,zip_code):
|
|
41 |
# _,o = send_request (8000000,19701)
|
42 |
# print(o)
|
43 |
|
44 |
-
def send_zillow_request (budget,zip_code):
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
|
57 |
|
58 |
|
|
|
4 |
import requests
|
5 |
import urllib.parse
|
6 |
import json
|
|
|
7 |
from fastapi import FastAPI, File, UploadFile, Form
|
8 |
+
# from Zillow_Scraper.selenium_wrapper import search
|
9 |
|
10 |
API_token = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1eG42aWVkcXlwMmtzbGVnZms2N3pmN3kyN2MzMTBsaSIsImlzcyI6ImRhdGFmaW5pdGkuY28ifQ.fwFM5-Z5ZMPwqbRuiyQhcQP9NjMqP-sm-EZ7W3BA2NnfqN6p0_Kapz6pr2tMGlZ7ranZ1DVb_gScmtPm8R_F6JpJ5dKNL7rZamUwR84TzxNPzOAns7UgjMSx-5p-7f9U2_NGg3ORveaQTfs1-QH9uiDw4v6U91lhD4rReXVgom5qhNlSbmHkj81DHVHaX969hPDtdEiQ5tspib3xgwWDyXYQYGcwPFoLIHET9srNP7zKWyghbiwh90DTnj3ASmYFO3Nrj8zdfXmkCkUXa1vwEf69qKD8T2L8-OsZlMn-t8X7uYyi_pFP4v78N_6SgfX1t8csRUqlymkFX-gVnqeDsPivSXvQrz9Su68g2HlMyOrutpdc7i6z3OCy8zt3HET_LMw4ccKHYeNxHJLf572ALRHvLVxWJTtEVPyqZ_IXHSHdhpk5jGvxSaW_T9ufmmeNfuLdDnOm_T1VhnXMI6-iAYDsWidSSzhQkrle8XcptRbyRyilMzU37BCd4klUiuVoMNJrBhIQEM9vgDEH8BfJHHOha3dCxWj0pKzlv4SHXokTlBVNDWg_vZFobylTOzsi0055PgenV-qiACzZpbFylTP0egdVKrxxfuOYe8fhzi61cwoaZ9YUqOspYRGsm_wRCwc3daS8SEvaEl1tXoRTpKsxe5kI6u7AVubqmhhI1LA'
|
11 |
# eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1MzRmanRmdmZwNnplcmJldHEzcnpienExZ2l6b201dyIsImlzcyI6ImRhdGFmaW5pdGkuY28ifQ.CONEaG0VEABopROdGvMWy3sBv0X8dB2rAUhijXEKRdRgAbII-zbX6FIZsV7pZ72M5BbaREhjOi9eU-5NKpvhiWnU8cjlrx0AmHRNrIBrHmPvoFE9IFeIN1pYS9nOvU6CctQB6ZvmoEMpF_VYVKwkBkmUNmY1UPF6TdINkdWg9ym0pC1TIhch4WM5akuHwlJXirzbV07SRrijnQUT1DRpt7_igbwRSt8smFUWejFDJnbxAaMeqsLHo7Trb3FgkBLAEHDdA7CgG2HONsAvOEKnf7hwpp3_mfziZ_uYO369wbfxkYIn6WnMqHYjjC6viD0b5zZI-hjZgT-87CUetWj3Oqs_B37JzqiHm0rxRHxlfFP_IvpqS263tjdnMgSUmsETy62W_cXAuk_Wn45nGiPfM26HclcZxBieYuCOFNojdZE-1apMehtXAgN0JEN29y5JZGBoSPHPZQKfvfAGEHlh-Ty3yZRiiPaQ2m4BLilZN2bB_tA0c8s7RXeHWph_t_GH5xoLO0PB_fZa_RrUmg-Cc2wsjTr59rYH-uGWpfhE-7Qa1du1tZYE4PpRqTq7KysAZzfuAgkhpJzpXwDAnuEsRDSGdhbteKnRIKajiEw8jt9KW0OnXEDOxx_cU9YrPmDvJIdvQjKKYz1Tuptce7ZmxXaHYoOtzN1I1aKpGQe1UJw
|
|
|
40 |
# _,o = send_request (8000000,19701)
|
41 |
# print(o)
|
42 |
|
43 |
+
# def send_zillow_request (budget,zip_code):
|
44 |
+
# inf = search(zipcode=zip_code, budget=budget, for_sale = "rent")
|
45 |
+
# return 1, inf
|
46 |
|
47 |
+
# # r = requests.post('https://api.datafiniti.co/v4/properties/search',json=request_data,headers=request_headers)
|
48 |
+
# # if r.status_code == 200:
|
49 |
+
# # out_data = json.loads(r.content.decode('utf8').replace('"', '\"'))
|
50 |
+
# # print("Founded result: ",out_data['num_found'])
|
51 |
+
# # return out_data['num_found'],out_data['records']
|
52 |
+
# # else:
|
53 |
+
# # print('Request failed')
|
54 |
+
# # return None,None
|
55 |
|
56 |
|
57 |
|
requirements.txt
CHANGED
@@ -1,2 +1,5 @@
|
|
1 |
langchain
|
2 |
-
openai
|
|
|
|
|
|
|
|
1 |
langchain
|
2 |
+
openai
|
3 |
+
fastapi
|
4 |
+
uvicorn
|
5 |
+
python-multipart
|
state_handler.py
CHANGED
@@ -8,7 +8,7 @@ from langchain.memory import ConversationBufferMemory
|
|
8 |
import os
|
9 |
import openai
|
10 |
from langchain.chat_models import ChatOpenAI
|
11 |
-
from api_call import send_request
|
12 |
from langchain.llms import LlamaCpp
|
13 |
from langchain.callbacks.manager import CallbackManager
|
14 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
|
|
8 |
import os
|
9 |
import openai
|
10 |
from langchain.chat_models import ChatOpenAI
|
11 |
+
from api_call import send_request
|
12 |
from langchain.llms import LlamaCpp
|
13 |
from langchain.callbacks.manager import CallbackManager
|
14 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|