Skip to content

Commit b98bd44

Browse files
chore: fix lint errors, format files
1 parent d481449 commit b98bd44

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/kit/models/config.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
import os
66
from dataclasses import dataclass, field
7-
from typing import Optional, Any, Dict
7+
from typing import Any, Dict, Optional
88

99

1010
@dataclass
1111
class OpenAIConfig:
1212
"""Configuration for OpenAI API access."""
13+
1314
api_key: Optional[str] = field(default_factory=lambda: os.environ.get("OPENAI_API_KEY"))
1415
model: str = "gpt-4o"
1516
temperature: float = 0.7
@@ -19,39 +20,38 @@ class OpenAIConfig:
1920
def __post_init__(self):
2021
if not self.api_key:
2122
raise ValueError(
22-
"OpenAI API key not found. "
23-
"Set OPENAI_API_KEY environment variable or pass api_key directly."
23+
"OpenAI API key not found. Set OPENAI_API_KEY environment variable or pass api_key directly."
2424
)
2525

2626

2727
@dataclass
2828
class AnthropicConfig:
2929
"""Configuration for Anthropic API access."""
30+
3031
api_key: Optional[str] = field(default_factory=lambda: os.environ.get("ANTHROPIC_API_KEY"))
3132
model: str = "claude-3-opus-20240229"
3233
temperature: float = 0.7
33-
max_tokens: int = 1000 # Corresponds to Anthropic's max_tokens_to_sample
34+
max_tokens: int = 1000 # Corresponds to Anthropic's max_tokens_to_sample
3435

3536
def __post_init__(self):
3637
if not self.api_key:
3738
raise ValueError(
38-
"Anthropic API key not found. "
39-
"Set ANTHROPIC_API_KEY environment variable or pass api_key directly."
39+
"Anthropic API key not found. Set ANTHROPIC_API_KEY environment variable or pass api_key directly."
4040
)
4141

4242

4343
@dataclass
4444
class GoogleConfig:
4545
"""Configuration for Google Generative AI API access."""
46+
4647
api_key: Optional[str] = field(default_factory=lambda: os.environ.get("GOOGLE_API_KEY"))
4748
model: str = "gemini-1.5-pro-latest"
4849
temperature: Optional[float] = 0.7
49-
max_output_tokens: Optional[int] = 1000 # Corresponds to Gemini's max_output_tokens
50+
max_output_tokens: Optional[int] = 1000 # Corresponds to Gemini's max_output_tokens
5051
model_kwargs: Optional[Dict[str, Any]] = field(default_factory=dict)
5152

5253
def __post_init__(self):
5354
if not self.api_key:
5455
raise ValueError(
55-
"Google API key not found. "
56-
"Set GOOGLE_API_KEY environment variable or pass api_key directly."
57-
)
56+
"Google API key not found. Set GOOGLE_API_KEY environment variable or pass api_key directly."
57+
)

src/kit/summaries.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
"""Handles code summarization using LLMs."""
22

33
import logging
4-
import os
5-
from dataclasses import dataclass, field
6-
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Protocol, Union, runtime_checkable
4+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
75

86
import tiktoken
97

10-
from kit.models.base import LLMClientProtocol, LLMError
8+
from kit.models.base import LLMError
119
from kit.models.config import AnthropicConfig, GoogleConfig, OpenAIConfig
1210

1311
# Conditionally import google.genai

0 commit comments

Comments
 (0)