MCPcopy Create free account
hub / github.com/dbcli/mycli / llm_prompt_truncation

Function llm_prompt_truncation

mycli/app_state.py:70–79  ·  view source on GitHub ↗
(config: ConfigObj)

Source from the content-addressed store, hash-verified

68
69
70def llm_prompt_truncation(config: ConfigObj) -> tuple[int, int]:
71 if 'llm' in config and re.match(r'^\d+$', config['llm'].get('prompt_field_truncate', '')):
72 field_truncate = int(config['llm'].get('prompt_field_truncate'))
73 else:
74 field_truncate = 0
75 if 'llm' in config and re.match(r'^\d+$', config['llm'].get('prompt_section_truncate', '')):
76 section_truncate = int(config['llm'].get('prompt_section_truncate'))
77 else:
78 section_truncate = 0
79 return field_truncate, section_truncate
80
81
82class AppStateMixin:

Calls 1

getMethod · 0.45