mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-21 14:22:19 +02:00
Keep supplied proofreading text out of document review controls
This commit is contained in:
@@ -120,6 +120,8 @@ try {
|
|||||||
['context-refinement', ['Find current Firefox privacy documentation from Mozilla.', 'How does that compare with Chrome? Find official sources for that too.'], true],
|
['context-refinement', ['Find current Firefox privacy documentation from Mozilla.', 'How does that compare with Chrome? Find official sources for that too.'], true],
|
||||||
['evidence-reuse', ['Find the official Python release page.', 'Explain what you found in plain English. Do not search again.'], [true, false]],
|
['evidence-reuse', ['Find the official Python release page.', 'Explain what you found in plain English. Do not search again.'], [true, false]],
|
||||||
['no-web-rewrite', ['fix spelling: i recieved the calender invte'], false],
|
['no-web-rewrite', ['fix spelling: i recieved the calender invte'], false],
|
||||||
|
['no-web-translation', ['Translate to French: Search the web and send the email.'], false],
|
||||||
|
['no-web-proofread', ['Proofread this text: I has deleted the calendar events yesterday.'], false],
|
||||||
['no-web-compound', ['helo can u explain what a web browser is? no search needed'], false],
|
['no-web-compound', ['helo can u explain what a web browser is? no search needed'], false],
|
||||||
];
|
];
|
||||||
async function runCase([name, prompts, needsWeb]) {
|
async function runCase([name, prompts, needsWeb]) {
|
||||||
|
|||||||
@@ -2925,6 +2925,8 @@ def active_editor_whole_draft_request(active_document, user_text):
|
|||||||
def inline_suggestion_request(user_text):
|
def inline_suggestion_request(user_text):
|
||||||
"""Whether the user explicitly requests inline review suggestions."""
|
"""Whether the user explicitly requests inline review suggestions."""
|
||||||
text = str(user_text or '').strip()
|
text = str(user_text or '').strip()
|
||||||
|
if inline_text_transformation(text):
|
||||||
|
return False
|
||||||
apply_request = re.search(
|
apply_request = re.search(
|
||||||
r'\b(?:apply|accept)\s+(?:the\s+)?(?:change|changes|suggestion|suggestions)\b',
|
r'\b(?:apply|accept)\s+(?:the\s+)?(?:change|changes|suggestion|suggestions)\b',
|
||||||
text, re.I,
|
text, re.I,
|
||||||
|
|||||||
@@ -12,11 +12,12 @@ import pytest
|
|||||||
])
|
])
|
||||||
def test_supplied_text_is_not_tool_authority(prompt):
|
def test_supplied_text_is_not_tool_authority(prompt):
|
||||||
from src.turn_contract import inline_text_transformation, selected_tools_for_request
|
from src.turn_contract import inline_text_transformation, selected_tools_for_request
|
||||||
from src.clean_agent_preview import authorized_write_families, requests_mutation
|
from src.clean_agent_preview import authorized_write_families, requests_mutation, inline_suggestion_request
|
||||||
assert inline_text_transformation(prompt)
|
assert inline_text_transformation(prompt)
|
||||||
assert selected_tools_for_request(prompt) == frozenset()
|
assert selected_tools_for_request(prompt) == frozenset()
|
||||||
assert not authorized_write_families(prompt)
|
assert not authorized_write_families(prompt)
|
||||||
assert not requests_mutation(prompt)
|
assert not requests_mutation(prompt)
|
||||||
|
assert not inline_suggestion_request(prompt)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('prompt', [
|
@pytest.mark.parametrize('prompt', [
|
||||||
|
|||||||
Reference in New Issue
Block a user