Skip to content

Commit

Permalink
tolerate higher and lower versions of langchain_anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
rblakemesser committed Mar 21, 2024
1 parent 4ddbf81 commit 73dc569
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions langdspy/prompt_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ def _invoke_with_retries(self, chain, input, max_tries=1, config: Optional[Runna
parsed_output[attr_name] = transformed_val

end_time = time.time()
try:
model_name = config["llm"].model_name
except AttributeError:
model_name = config["llm"].model

self.prompt_history.add_entry(config["llm"].model_name, formatted_prompt, res, parsed_output, validation_err, start_time, end_time)

res = {attr_name: parsed_output.get(attr_name, None) for attr_name in self.template.output_variables.keys()}
Expand Down

0 comments on commit 73dc569

Please sign in to comment.