-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Multi Agent PDF saving fix #1008
Comments
Welcome @kcalhoon Possible to get this as a PR? We'd love to carve your name into the tree |
Hey hi.. i am trying to run gpt-researcher using google colab but it is throwing the below error. i tried multiple ways. but nothing worked out /usr/local/lib/python3.10/dist-packages/gpt_researcher/actions/agent_creator.py in choose_agent(query, cfg, parent_query, cost_callback, headers) 22 frames /usr/local/lib/python3.10/dist-packages/gpt_researcher/llm_provider/generic/base.py in get_chat_response(self, messages, stream, websocket) /usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py in ainvoke(self, input, config, stop, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py in agenerate_prompt(self, prompts, stop, callbacks, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py in agenerate(self, messages, stop, callbacks, tags, metadata, run_name, run_id, **kwargs) /usr/lib/python3.10/asyncio/tasks.py in __step(failed resolving arguments) /usr/local/lib/python3.10/dist-packages/langchain_core/language_models/chat_models.py in _agenerate_with_cache(self, messages, stop, run_manager, **kwargs) /usr/local/lib/python3.10/dist-packages/langchain_openai/chat_models/base.py in _agenerate(self, messages, stop, run_manager, **kwargs) /usr/local/lib/python3.10/dist-packages/openai/resources/chat/completions.py in create(self, messages, model, audio, frequency_penalty, function_call, functions, logit_bias, logprobs, max_completion_tokens, max_tokens, metadata, modalities, n, parallel_tool_calls, prediction, presence_penalty, response_format, seed, service_tier, stop, store, stream, stream_options, temperature, tool_choice, tools, top_logprobs, top_p, user, extra_headers, extra_query, extra_body, timeout) /usr/local/lib/python3.10/dist-packages/openai/_base_client.py in post(self, path, cast_to, body, files, options, stream, stream_cls) /usr/local/lib/python3.10/dist-packages/openai/_base_client.py in request(self, cast_to, options, stream, stream_cls, remaining_retries) /usr/local/lib/python3.10/dist-packages/openai/_base_client.py in _request(self, cast_to, options, stream, stream_cls, retries_taken) NotFoundError: Error code: 404 - {'error': {'message': 'The model During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/nest_asyncio.py in run(main, debug) /usr/local/lib/python3.10/dist-packages/nest_asyncio.py in run_until_complete(self, future) /usr/lib/python3.10/asyncio/futures.py in result(self) /usr/lib/python3.10/asyncio/tasks.py in __step(failed resolving arguments) in get_report(query, report_type) /usr/local/lib/python3.10/dist-packages/gpt_researcher/agent.py in conduct_research(self) /usr/local/lib/python3.10/dist-packages/gpt_researcher/actions/agent_creator.py in choose_agent(query, cfg, parent_query, cost_callback, headers) /usr/local/lib/python3.10/dist-packages/gpt_researcher/actions/agent_creator.py in handle_json_error(response) /usr/local/lib/python3.10/dist-packages/gpt_researcher/actions/agent_creator.py in extract_json_with_regex(response) /usr/lib/python3.10/re.py in search(pattern, string, flags) TypeError: expected string or bytes-like object |
@ElishaKay I also bumped into it, taking care of this as soon as the other PR, 1070 is merged |
Describe the bug
An error is thrown when trying to save the output to pdf
To Reproduce
Run any query
Expected behavior
A pdf will be saved along with .md and .docx
Solution
In multi_agents/agents/utils/file_formats.py, I modified the css_file_path to:
"css_file_path="./multi_agents/agents/utils/pdf_styles.css""
Code Snippet
`async def write_md_to_pdf(text: str, path: str) -> str:
"""Converts Markdown text to a PDF file and returns the file path.
The text was updated successfully, but these errors were encountered: