Skip to content

Commit

Permalink
Format Python code with psf/black push
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and github-actions committed Apr 24, 2023
1 parent 6f6ca59 commit a1fa44f
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions cogs/search_service_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,25 @@
GoogleSearchAPIWrapper,
WolframAlphaAPIWrapper,
FAISS,
InMemoryDocstore, LLMChain, ConversationChain,
InMemoryDocstore,
LLMChain,
ConversationChain,
)
from langchain.agents import (
Tool,
initialize_agent,
AgentType,
ZeroShotAgent,
AgentExecutor,
)
from langchain.agents import Tool, initialize_agent, AgentType, ZeroShotAgent, AgentExecutor
from langchain.chat_models import ChatOpenAI
from langchain.memory import ConversationBufferMemory, CombinedMemory
from langchain.prompts import ChatPromptTemplate, SystemMessagePromptTemplate, MessagesPlaceholder, \
HumanMessagePromptTemplate
from langchain.prompts import (
ChatPromptTemplate,
SystemMessagePromptTemplate,
MessagesPlaceholder,
HumanMessagePromptTemplate,
)
from langchain.requests import TextRequestsWrapper, Requests
from llama_index import (
GPTSimpleVectorIndex,
Expand Down Expand Up @@ -52,7 +64,9 @@
def my_parse(self, text):
# Remove all pairs of triple backticks from the input. However, don't remove pairs of ```json and ```. Only remove ``` and ``` pairs, maintain the text between the pairs so that only the backticks
# are removed and the text is left intact.
text_without_triple_backticks = re.sub(r"```(?!json)(.*?)```", r"\1", text, flags=re.DOTALL)
text_without_triple_backticks = re.sub(
r"```(?!json)(.*?)```", r"\1", text, flags=re.DOTALL
)

# Call the original parse() method with the modified input
try:
Expand Down Expand Up @@ -138,7 +152,7 @@ def get(self, url: str, **kwargs: Any) -> str:
except:
url = url
use_gpt4 = False
original_query="No Original Query Provided"
original_query = "No Original Query Provided"

use_gpt4 = use_gpt4 == "True"
"""GET the URL and return the text."""
Expand Down

0 comments on commit a1fa44f

Please sign in to comment.