Files
llm-in-text/backend/__pycache__/prompt.cpython-313.pyc

66 lines
3.7 KiB
Plaintext
Raw Normal View History

<EFBFBD>
<00><><EFBFBD>i <00> <00>h<00>SSKJr SrSrS\S\4SjrS\S\S\\\44S jrS S\S\S\S\4S
jjrg ) <0A>)<01>Tuplei<65>.i<><00> language_id<69>returnc<00><><00>U(dg/nUR5H1nUR5(dUS;dM URU5 M3 SRU5SSnU=(d S$)N<>markdownz-_+.<2E><00> )<04>strip<69>isalnum<75>append<6E>join)r<00>allowed<65>ch<63>values <20>backend/prompt.py<70>_sanitize_language_idrs_<00><00> <16><19><10>G<EFBFBD><19><1F><1F>!<21><02> <0A>:<3A>:<3A><<3C><<3C>2<EFBFBD><16><<3C> <13>N<EFBFBD>N<EFBFBD>2<EFBFBD> <1E>"<22> <0F>G<EFBFBD>G<EFBFBD>G<EFBFBD> <1C>S<EFBFBD>b<EFBFBD> !<21>E<EFBFBD> <10> <1E>J<EFBFBD><1E><00>prefix<69>suffixc<00>N<00>U(a XS-nUSSnU[*SUS[4$)z
Prepare prefix/suffix for model completion context.
Keep the historical one-char lookahead behavior to reduce boundary drift.
r<00>N)<02>MAX_PREFIX_CHARS<52>MAX_SUFFIX_CHARS)rrs r<00>_prepare_contextrs><00><00>
<0E><17><11>)<29>#<23><06><17><01><02><1A><06> <11>#<23>#<23>$<24> %<25>v<EFBFBD>.?<3F>/?<3F>'@<40> @<40>@rc<00>j<00>[U5n[X5upESUSUSUS3nUR5$)Nz*You are an inline completion engine for a a<> editor with ghost-text suggestions.
Your job:
- Return ONLY the text that should be inserted at the cursor between PREFIX and SUFFIX.
- Prefer a meaningful, non-empty insertion with moderate length.
- Avoid overly short outputs with little information value.
Important context:
- PREFIX may contain hidden OCR metadata in HTML comments such as <!--OCR:...-->.
- These comments are non-visible context only.
- Never copy, rewrite, or emit HTML comments in output.
- Never output <!-- or -->.
Hard rules:
1. Seamless join:
PREFIX + OUTPUT + SUFFIX must read naturally as one continuous document.
2. No suffix repetition:
Do NOT repeat text that already appears at the start of SUFFIX.
3. Balanced length:
Prefer concise but meaningful continuation, not ultra-short fragments.
Default target is 20-120 characters and 1-3 lines.
You may go shorter only when syntax requires it.
4. Avoid trivial output:
Do not output only punctuation or filler such as ".", ",", ";", ":".
Do not output just one token unless it is structurally necessary.
5. Preserve local style:
Match nearby language, tone, punctuation, spacing, and indentation.
6. Markdown awareness:
Continue active list/checkbox/ordered-list patterns when applicable.
Preserve indentation in nested list/code contexts.
Close obvious unclosed inline markdown markers only when needed to bridge.
7. Strict output format:
Output insertion text only.
No explanations, labels, quotes, or code fences.
Decision policy:
- If PREFIX already connects naturally to SUFFIX, add a brief but useful continuation when possible.
- If uncertain, prefer a complete short phrase or sentence with clear meaning.
Examples:
<PREFIX>The quick brown fox </PREFIX>
<SUFFIX>jumps over the lazy dog.</SUFFIX>
Output: "moved quietly and then "
<PREFIX>## TODO\n- [ ] Buy milk\n- [ ] </PREFIX>
<SUFFIX></SUFFIX>
Output: "Write release notes and share draft with team"
Now produce the insertion.
<PREFIX>
z
</PREFIX>
<SUFFIX>
z
</SUFFIX>
Output:)rrr
)rrr<00>safe_language_id<69> recent_prefix<69> recent_suffix<69>prompts r<00> build_promptr sY<00><00>,<2C>[<5B>9<><14>#3<>F<EFBFBD>#C<> <20>M<EFBFBD>;<3B><L<>;M<>3N<01>f<0F><0F><01><0F><0F><08>o: <0B>F<EFBFBD>x <12><<3C><<3C>><3E>rN)r)<08>typingrrr<00>strrrr <00>rr<00><module>r$ss<00><01><18><18><10><17><10><1F>s<EFBFBD><1F>s<EFBFBD><1F>A<01>S<EFBFBD>A<01>#<23>A<01>%<25><03>S<EFBFBD><08>/<2F>A<01>@<1A><13>@<1A>c<EFBFBD>@<1A><03>@<1A>S<EFBFBD>@r