Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
monk1337 authored Jul 29, 2023
1 parent aaf8d96 commit 6dbeb3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions promptify/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, prompter, model, structured_output=True, **kwargs):

self.prompters = prompter
self.model = model
self.max_completion_length: int = kwargs.get("max_completion_length", 20)
self.json_depth_limit: int = kwargs.get("json_depth_limit", 20)
self.cache_prompt = kwargs.get("cache_prompt", True)
self.cache_size = kwargs.get("cache_size", 200)
self.prompt_cache = PromptCache(self.cache_size)
Expand Down Expand Up @@ -94,12 +94,12 @@ def _get_output_from_cache_or_model(self, template):

if self.structured_output:
output = self.model.model_output(
response, max_completion_length=self.max_completion_length
response, max_completion_length=self.json_depth_limit
)
else:
output = response

if self.cache_prompt:
self.prompt_cache.add(template, output)

return output
return output

0 comments on commit 6dbeb3e

Please sign in to comment.