MCPcopy
hub / github.com/oobabooga/textgen / send_dummy_message

Function send_dummy_message

modules/chat.py:1745–1761  ·  view source on GitHub ↗
(text, state)

Source from the content-addressed store, hash-verified

1743
1744
1745def send_dummy_message(text, state):
1746 history = state['history']
1747
1748 # Handle both dict and string inputs
1749 if isinstance(text, dict):
1750 text = text['text']
1751
1752 # Initialize metadata if not present
1753 if 'metadata' not in history:
1754 history['metadata'] = {}
1755
1756 row_idx = len(history['internal'])
1757 history['visible'].append([html.escape(text), ''])
1758 history['internal'].append([apply_extensions('input', text, state, is_chat=True), ''])
1759 update_message_metadata(history['metadata'], "user", row_idx, timestamp=get_current_timestamp())
1760
1761 return history
1762
1763
1764def send_dummy_reply(text, state):

Callers 2

Calls 3

apply_extensionsFunction · 0.90
update_message_metadataFunction · 0.85
get_current_timestampFunction · 0.70

Tested by

no test coverage detected