Skip to content

Commit 5ac3679

Browse files
fix: formatting errors and improper initializations.
1 parent be5c5a7 commit 5ac3679

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

.github/ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ select = [
1313
"UP", # pyupgrade
1414
]
1515
ignore = [
16+
"E501", # ignore line too long.
1617
"B008", # do not perform function calls in argument defaults
1718
]

jigsawstack/async_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
path: str,
2626
params: Union[Dict[Any, Any], List[Dict[Any, Any]]],
2727
verb: RequestVerb,
28-
headers: Dict[str, str] = {"Content-Type": "application/json"},
28+
headers: Dict[str, str] = None,
2929
data: Union[bytes, None] = None,
3030
stream: Union[bool, None] = False,
3131
):
@@ -35,7 +35,7 @@ def __init__(
3535
self.api_url = config.get("api_url")
3636
self.api_key = config.get("api_key")
3737
self.data = data
38-
self.headers = headers
38+
self.headers = headers or {"Content-Type": "application/json"}
3939
self.disable_request_logging = config.get("disable_request_logging")
4040
self.stream = stream
4141

jigsawstack/prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PredictionParams(TypedDict):
2727
"""
2828
steps: int
2929
"""
30-
The number of predictions to make. The defualt is 5.
30+
The number of predictions to make. The default is 5.
3131
"""
3232

3333

jigsawstack/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
path: str,
2626
params: Union[Dict[Any, Any], List[Dict[Any, Any]]],
2727
verb: RequestVerb,
28-
headers: Dict[str, str] = {"Content-Type": "application/json"},
28+
headers: Dict[str, str] = None,
2929
data: Union[bytes, None] = None,
3030
stream: Union[bool, None] = False,
3131
):
@@ -35,7 +35,7 @@ def __init__(
3535
self.api_url = config.get("api_url")
3636
self.api_key = config.get("api_key")
3737
self.data = data
38-
self.headers = headers
38+
self.headers = headers or {"Content-Type": "application/json"}
3939
self.disable_request_logging = config.get("disable_request_logging")
4040
self.stream = stream
4141

tests/test_summary.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
async_jigsaw = jigsawstack.AsyncJigsawStack(api_key=os.getenv("JIGSAWSTACK_API_KEY"))
1717

1818
LONG_TEXT = """
19-
Artificial Intelligence (AI) has become one of the most transformative technologies of the 21st century.
20-
From healthcare to finance, transportation to entertainment, AI is reshaping industries and changing the way we live and work.
21-
Machine learning algorithms can now diagnose diseases with remarkable accuracy, predict market trends, and even create art.
22-
Natural language processing has enabled computers to understand and generate human language, leading to the development of sophisticated chatbots and virtual assistants.
23-
Computer vision systems can identify objects, faces, and activities in images and videos with superhuman precision.
24-
However, the rapid advancement of AI also raises important ethical questions about privacy, job displacement, and the potential for bias in algorithmic decision-making.
25-
As we continue to develop more powerful AI systems, it's crucial that we consider their societal impact and work to ensure that the benefits of AI are distributed equitably.
19+
Artificial Intelligence (AI) has become one of the most transformative technologies of the 21st century.
20+
From healthcare to finance, transportation to entertainment, AI is reshaping industries and changing the way we live and work.
21+
Machine learning algorithms can now diagnose diseases with remarkable accuracy, predict market trends, and even create art.
22+
Natural language processing has enabled computers to understand and generate human language, leading to the development of sophisticated chatbots and virtual assistants.
23+
Computer vision systems can identify objects, faces, and activities in images and videos with superhuman precision.
24+
However, the rapid advancement of AI also raises important ethical questions about privacy, job displacement, and the potential for bias in algorithmic decision-making.
25+
As we continue to develop more powerful AI systems, it's crucial that we consider their societal impact and work to ensure that the benefits of AI are distributed equitably.
2626
The future of AI holds immense promise, but it will require careful planning, regulation, and collaboration between technologists, policymakers, and society at large to realize its full potential while mitigating its risks.
2727
"""
2828

@@ -112,9 +112,9 @@
112112
"name": "technical_text_summary",
113113
"params": {
114114
"text": """
115-
Machine learning is a subset of artificial intelligence that focuses on the development of algorithms and statistical models that enable computer systems to improve their performance on a specific task through experience.
116-
Deep learning, a subfield of machine learning, uses artificial neural networks with multiple layers to progressively extract higher-level features from raw input.
117-
Supervised learning involves training models on labeled data, while unsupervised learning discovers patterns in unlabeled data.
115+
Machine learning is a subset of artificial intelligence that focuses on the development of algorithms and statistical models that enable computer systems to improve their performance on a specific task through experience.
116+
Deep learning, a subfield of machine learning, uses artificial neural networks with multiple layers to progressively extract higher-level features from raw input.
117+
Supervised learning involves training models on labeled data, while unsupervised learning discovers patterns in unlabeled data.
118118
Reinforcement learning enables agents to learn optimal behaviors through trial and error interactions with an environment.
119119
""",
120120
"type": "points",

0 commit comments

Comments
 (0)