Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Jan 20, 2025
1 parent 710ca68 commit a3311df
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions extra/OpenWebuiTool/openwebui_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
__description__ = "Lightrag integration for OpenWebui"


import os
import requests
import json
import csv
from io import StringIO
from pydantic import BaseModel, Field
from typing import Callable, Any, Literal, Union, List, Tuple

Expand Down Expand Up @@ -238,7 +235,7 @@ def extract_code_blocks(
remaining = remaining[index + 3 :]
first_index += index + 3
bloc_index += 1
except Exception as ex:
except Exception:
if bloc_index % 2 == 1:
index = len(remaining)
indices.append(index)
Expand Down Expand Up @@ -293,11 +290,11 @@ def extract_code_blocks(
if len(sub_text) > 0:
try:
find_space = sub_text.index(" ")
except:
except Exception:
find_space = int(1e10)
try:
find_return = sub_text.index("\n")
except:
except Exception:
find_return = int(1e10)
next_index = min(find_return, find_space)
if "{" in sub_text[:next_index]:
Expand Down

0 comments on commit a3311df

Please sign in to comment.