Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkbrnd committed Dec 21, 2024
1 parent c50eeb6 commit b2915ed
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions cookbook/tools/zoom_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def get_access_token(self) -> str:
"""
Obtain or refresh the access token for Zoom API.
to get the account_id ,client_id ,client_secret
To get the account_id, client_id, client_secret
https://developers.zoom.us/docs/internal-apps/create/
for oauth 2.0
For oauth 2.0
https://developers.zoom.us/docs/integrations/oauth/
Returns:
A string containing the access token or an empty string if token retrieval fails.
Expand All @@ -47,7 +47,10 @@ def get_access_token(self) -> str:

try:
response = requests.post(
self.token_url, headers=headers, data=data, auth=(self.client_id, self.client_secret)
self.token_url,
headers=headers,
data=data,
auth=(self.client_id, self.client_secret), # type: ignore
)
response.raise_for_status()

Expand Down
8 changes: 4 additions & 4 deletions phi/model/cohere/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from phi.utils.tools import get_function_call_for_tool_call

try:
from cohere import Client as CohereClient
from cohere import Client as CohereClient, ToolCall
from cohere.types.tool import Tool as CohereTool
from cohere.types.non_streamed_chat_response import NonStreamedChatResponse
from cohere.types.streamed_chat_response import (
Expand Down Expand Up @@ -286,7 +286,7 @@ def _handle_tool_calls(
self,
assistant_message: Message,
messages: List[Message],
response_tool_calls: List[Any],
response_tool_calls: List[ToolCall],
model_response: ModelResponse,
) -> Optional[Any]:
"""
Expand All @@ -295,7 +295,7 @@ def _handle_tool_calls(
Args:
assistant_message (Message): The assistant message.
messages (List[Message]): The list of messages.
response_tool_calls (List[Any]): The list of response tool calls.
response_tool_calls (List[ToolCall]): The list of response tool calls.
model_response (ModelResponse): The model response.
Returns:
Expand Down Expand Up @@ -420,7 +420,7 @@ def response(self, messages: List[Message], tool_results: Optional[List[ToolResu
tool_results = self._handle_tool_calls(
assistant_message=assistant_message,
messages=messages,
response_tool_calls=response_tool_calls,
response_tool_calls=response_tool_calls, # type: ignore
model_response=model_response,
)

Expand Down
2 changes: 1 addition & 1 deletion phi/tools/calcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_available_slots(
"eventTypeId": self.event_type_id,
}

response = requests.get(url, headers=self._get_headers(), params=querystring)
response = requests.get(url, headers=self._get_headers(), params=querystring) # type: ignore
if response.status_code == 200:
slots = response.json()["data"]["slots"]
available_slots = []
Expand Down
2 changes: 1 addition & 1 deletion phi/tools/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

def authenticate(self):
"""Authenticate with GitHub using the provided access token."""
auth = Auth.Token(self.access_token)
auth = Auth.Token(self.access_token) # type: ignore
if self.base_url:
logger.debug(f"Authenticating with GitHub Enterprise at {self.base_url}")
return Github(base_url=self.base_url, auth=auth)
Expand Down
2 changes: 1 addition & 1 deletion phi/tools/zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_upcoming_meetings(self, user_id: str = "me") -> str:
params = {"type": "upcoming", "page_size": 30}

try:
response = requests.get(url, headers=headers, params=params)
response = requests.get(url, headers=headers, params=params) # type: ignore
response.raise_for_status()
meetings = response.json()

Expand Down
2 changes: 1 addition & 1 deletion phi/vectordb/qdrant/qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def client(self) -> QdrantClient:
https=self.https,
api_key=self.api_key,
prefix=self.prefix,
timeout=self.timeout,
timeout=self.timeout, # type: ignore
host=self.host,
path=self.path,
**self.kwargs,
Expand Down

0 comments on commit b2915ed

Please sign in to comment.