Skip to content

Commit

Permalink
fix: Increased the request timeout for Ollama. Added exception type i…
Browse files Browse the repository at this point in the history
…n workflow exception message.
  • Loading branch information
anirbanbasu committed Sep 16, 2024
1 parent 194c7f0 commit 0133c74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def set_llm_provider(self, provider: str | None = None):
EnvironmentVariables.KEY__LLM_OLLAMA_URL,
default_value=EnvironmentVariables.VALUE__LLM_OLLAMA_URL,
),
# Increase the timeout to 180 seconds to allow for longer queries on slower computers.
request_timeout=180.0,
model=parse_env(
EnvironmentVariables.KEY__LLM_OLLAMA_MODEL,
default_value=EnvironmentVariables.VALUE__LLM_OLLAMA_MODEL,
Expand Down
2 changes: 1 addition & 1 deletion src/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ async def run(self, query: str):
result = await task
done = self.workflow.is_done()
except Exception as e:
result = f"Exception in running the workflow(s): {str(e)}"
result = f"\nException in running the workflow(s). Type: {type(e).__name__}. Message: '{str(e)}'"
# Set this to done, otherwise another workflow call cannot be made.
done = True
print(result, file=sys.stderr)
Expand Down

0 comments on commit 0133c74

Please sign in to comment.