refiner#

Attributes#

log

Classes#

Module Contents#

refiner.log#
class refiner.JanusRefiner#

Bases: janus.parsers.parser.JanusParser

parser: janus.parsers.parser.JanusParser#
parse_runnable(input)#
Parameters:

input (dict[str, Any]) –

Return type:

Any

parse_completion(completion, **kwargs)#
Parameters:

completion (str) –

Return type:

Any

abstract parse(text)#
Parameters:

text (str) –

Return type:

str

class refiner.FixParserExceptions(llm, parser, max_retries)#

Bases: JanusRefiner, langchain.output_parsers.RetryWithErrorOutputParser

Parameters:
parse_completion(completion, prompt_value, **kwargs)#
Parameters:
  • completion (str) –

  • prompt_value (langchain_core.prompt_values.PromptValue) –

Return type:

Any

class refiner.ReflectionRefiner(llm, parser, max_retries, prompt_template_name='refinement/reflection')#

Bases: JanusRefiner

Parameters:
max_retries: int#
reflection_chain: langchain_core.runnables.RunnableSerializable#
revision_chain: langchain_core.runnables.RunnableSerializable#
reflection_prompt_name: str#
parse_completion(completion, prompt_value, **kwargs)#
Parameters:
  • completion (str) –

  • prompt_value (langchain_core.prompt_values.PromptValue) –

Return type:

Any

class refiner.HallucinationRefiner(**kwargs)#

Bases: ReflectionRefiner