Skip to content

Error in running example.py #48

@Vmstudygmail

Description

@Vmstudygmail

Hi @EthanC111 @steffichern @pfliu-nlp @eltociear

I have followed the developer's step to install/run example.py but running into issues.
Could someone please help!
Thanks!

$python3 example.py
SystemLog: [2024-10-18 02:03:37][scholarly][INFO] - Successful ScraperAPI requests 0 / 1000
SystemLog: [2024-10-18 02:03:38][scholarly][INFO] - Successful ScraperAPI requests 0 / 1000
SystemLog: [2024-10-18 02:03:38][scholarly][INFO] - ScraperAPI proxy setup successfully
SystemLog: [2024-10-18 02:03:38][scholarly][INFO] - Proxy works! IP address: 99.105.57.137
SystemLog: [2024-10-18 02:03:39][scholarly][INFO] - Proxy works! IP address: 99.105.57.137
0
1 retry left...
SystemLog: [2024-10-18 02:03:40][openai][INFO] - message='OpenAI API response' path=https://api.openai.com/v1/chat/completions processing_ms=1095 request_id=req_76ae79e76b3e4d5a681e5f427ceea70c response_code=200
1 retry left...
SystemLog: [2024-10-18 02:03:42][openai][INFO] - message='OpenAI API response' path=https://api.openai.com/v1/chat/completions processing_ms=1143 request_id=req_b83fc9390f24d7a222d080ac270bb36f response_code=200
Traceback (most recent call last):
File "/home/vm/work/factool/example/example.py", line 88, in
response_list = factool_instance.run(inputs)
File "/home/vm/work/factool/factool/factool.py", line 72, in run
batch_results = asyncio.run(
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/vm/work/factool/factool/knowledge_qa/pipeline.py", line 106, in run_with_tool_api_call
claims_in_responses, queries_in_responses, evidences_in_responses, sources_in_responses, verifications_in_responses = await self.run_with_tool_live(responses[batch_start:batch_end])
File "/home/vm/work/factool/factool/knowledge_qa/pipeline.py", line 73, in run_with_tool_live
search_outputs_for_claims = await self.tool.run(queries)
File "/home/vm/work/factool/factool/knowledge_qa/tool.py", line 15, in run
return await self.serper.run(queries)
File "/home/vm/work/factool/factool/knowledge_qa/google_serper.py", line 113, in run
snippets_list.append(self._parse_results(results[i]))
File "/home/vm/work/factool/factool/knowledge_qa/google_serper.py", line 50, in _parse_results
if results.get("answerBox"):
AttributeError: 'ClientResponseError' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions