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

[AutoPR] TODO subtract length of rest of prompt #127

Open
github-actions bot opened this issue Nov 5, 2023 · 0 comments
Open

[AutoPR] TODO subtract length of rest of prompt #127

github-actions bot opened this issue Nov 5, 2023 · 0 comments
Labels

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2023

TODO subtract length of rest of prompt

def build_prompt_and_instructions(self, inputs: Inputs) -> tuple[str, str]:
# Build prompt
prompt_elements = []
if inputs.prompt_context:
# TODO subtract length of rest of prompt
prompt_elements.append(
str(
trim_context(
inputs.prompt_context,
inputs.max_prompt_tokens,

choices_bullet_points = "\n".join(f"- {choice}" for choice in inputs.choices)
# Build prompt
prompt_elements = []
if inputs.prompt_context:
# TODO subtract length of rest of prompt
prompt_elements.append(
str(
trim_context(
inputs.prompt_context,
inputs.max_prompt_tokens,

To resolve this TODO, you can start by calculating the length of the rest of the prompt. Then, subtract that length from the total length of the prompt to get the desired result. Make sure to handle any edge cases or error scenarios that may arise.

@github-actions github-actions bot added the medium label Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants