Harrison/fix lint (#138)

harrison/prompts_take_2
Harrison Chase 2 years ago committed by GitHub
parent 76cecf8165
commit 9f223e6ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -59,7 +59,7 @@ class MapReduceChain(Chain, BaseModel):
def _call(self, inputs: Dict[str, str]) -> Dict[str, str]:
# Split the larger text into smaller chunks.
docs = self.text_splitter.split_text(inputs[self.input_key],)
docs = self.text_splitter.split_text(inputs[self.input_key])
# Now that we have the chunks, we send them to the LLM and track results.
# This is the "map" part.
summaries = []

@ -28,8 +28,7 @@ class Crawler:
"Could not import playwright python package. "
"Please it install it with `pip install playwright`."
)
self.browser = sync_playwright().start().chromium.launch(headless=False,)
self.browser = sync_playwright().start().chromium.launch(headless=False)
self.page = self.browser.new_page()
self.page.set_viewport_size({"width": 1280, "height": 1080})

@ -109,4 +109,4 @@ Action 3: Finish[yes]""",
]
SUFFIX = """\n\nQuestion: {input}"""
PROMPT = Prompt.from_examples(EXAMPLES, SUFFIX, ["input"],)
PROMPT = Prompt.from_examples(EXAMPLES, SUFFIX, ["input"])

@ -38,4 +38,4 @@ Intermediate Answer: New Zealand.
So the final answer is: No
Question: {input}"""
PROMPT = Prompt(input_variables=["input"], template=_DEFAULT_TEMPLATE,)
PROMPT = Prompt(input_variables=["input"], template=_DEFAULT_TEMPLATE)

@ -15,5 +15,5 @@ Only use the following tables:
Question: {input}"""
PROMPT = Prompt(
input_variables=["input", "table_info", "dialect"], template=_DEFAULT_TEMPLATE,
input_variables=["input", "table_info", "dialect"], template=_DEFAULT_TEMPLATE
)

@ -121,7 +121,7 @@ class AI21(BaseModel, LLM):
response = requests.post(
url=f"https://api.ai21.com/studio/v1/{self.model}/complete",
headers={"Authorization": f"Bearer {self.ai21_api_key}"},
json={"prompt": prompt, "stopSequences": stop, **self._default_params,},
json={"prompt": prompt, "stopSequences": stop, **self._default_params},
)
if response.status_code != 200:
optional_detail = response.json().get("error")

@ -45,7 +45,7 @@ class ElasticVectorSearch(VectorStore):
"""
def __init__(
self, elasticsearch_url: str, index_name: str, embedding_function: Callable,
self, elasticsearch_url: str, index_name: str, embedding_function: Callable
):
"""Initialize with necessary components."""
try:

@ -6,7 +6,7 @@ def test_manifest_wrapper() -> None:
"""Test manifest wrapper."""
from manifest import Manifest
manifest = Manifest(client_name="openai",)
manifest = Manifest(client_name="openai")
llm = ManifestWrapper(client=manifest, llm_kwargs={"temperature": 0})
output = llm("The capital of New York is:")
assert output == "Albany"

Loading…
Cancel
Save