Skip to content

Commit

Permalink
linter stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmvd committed Dec 23, 2024
1 parent 53a6f82 commit 97152e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions timesketch/lib/llms/aistudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"""Google AI Studio LLM provider."""

import json
from typing import Optional
from timesketch.lib.llms import interface
from timesketch.lib.llms import manager
from typing import Optional


# Check if the required dependencies are installed.
Expand Down Expand Up @@ -56,10 +56,12 @@ def generate(self, prompt: str, response_schema: Optional[dict] = None) -> str:
Args:
prompt: The prompt to use for the generation.
response_schema: An optional JSON schema to define the expected response format.
response_schema: An optional JSON schema to define the expected
response format.
Returns:
The generated text as a string (or parsed data if response_schema is provided).
The generated text as a string (or parsed data if
response_schema is provided).
"""

generation_config = genai.GenerationConfig(
Expand All @@ -83,7 +85,7 @@ def generate(self, prompt: str, response_schema: Optional[dict] = None) -> str:
return json.loads(response.text)
except Exception as error:
raise ValueError(
f"Error JSON parsing text: {response.text}: {e}"
f"Error JSON parsing text: {response.text}: {error}"
) from error
return response.text

Expand Down

0 comments on commit 97152e3

Please sign in to comment.