Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional fields #28

Merged
merged 20 commits into from
Jul 10, 2024
Merged

Optional fields #28

merged 20 commits into from
Jul 10, 2024

Conversation

aelaguiz
Copy link
Owner

  • Adds a FakeLLM pattern (See test_fake_anthropic) for tests
  • Adds support for any number of optional output fields:
class OptionalOutputPromptSignature(PromptSignature):
    input1 = InputField(name="input1", desc="Input field 1")
    input2 = InputField(name="input2", desc="Input field 2")
    output1 = OutputField(name="output1", desc="Output field 1")
    output2 = OutputField(name="output2", desc="Output field 2", optional=True)

This is useful for handling degraded responses from models cleanly.

…FailedPromptStrategy classes to address pytest collection warnings.
Implemented tests for failed prompts, including missing inputs, extra inputs, and missing outputs, and suppressed pytest collection warnings.
…asses to `FailedPromptSignature` and `FailedPromptStrategy`, respectively, and added an import statement for `langchain_contrib`.
…ass to improve readability and maintainability.
…ropic' LLM type in prompt formatting and output parsing.
…the expected and received input keys in the correct order.
…tailed information about missing or unexpected keys.
@aelaguiz aelaguiz merged commit b7bd813 into main Jul 10, 2024
1 check passed

llm_model = self._determine_llm_model(config['llm'])

hard_fail = config.get('hard_fail', True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah this file is a lot cleaner now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants