Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update request body #34

Merged
merged 2 commits into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions any_parser/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
CAMBIO_PARSE_URL = (
"https://qreije6m7l.execute-api.us-west-2.amazonaws.com/v1/cambio_api/parse"
)
COMBIO_INSTRUCT_URL = (
CAMBIO_INSTRUCT_URL = (
"https://qreije6m7l.execute-api.us-west-2.amazonaws.com/v1/cambio_api/instruction"
)

Expand All @@ -21,7 +21,7 @@ def __init__(self, apiKey) -> None:
self._uploadurl = CAMBIO_UPLOAD_URL
self._extracturl = CAMBIO_EXTRACT_URL
self._parseurl = CAMBIO_PARSE_URL
self._instructurl = COMBIO_INSTRUCT_URL
self._instructurl = CAMBIO_INSTRUCT_URL
self._request_header = {"x-api-key": apiKey}

def setAPIKey(self, apiKey):
Expand Down Expand Up @@ -95,8 +95,7 @@ def _request_info_extraction(self, user_id, job_id, s3_key, mode, prompt=""):
"userId": user_id,
"jobId": job_id,
"fileKey": s3_key,
"user_prompt": prompt,
"use_textract": "True" if mode == "advanced" else "False",
"userPrompt": prompt,
}
response = requests.post(
self._parseurl, headers=self._request_header, json=payload
Expand All @@ -115,8 +114,7 @@ def _request_instruction_extraction(self, user_id, job_id, s3_key, mode, prompt=
"userId": user_id,
"jobId": job_id,
"fileKey": s3_key,
"user_prompt": prompt,
"use_textract": "True" if mode == "advanced" else "False",
"userPrompt": prompt,
}
response = requests.post(
self._instructurl, headers=self._request_header, json=payload
Expand Down
Loading