fix(gui): Resolve MiniMax compression error and fix Markdown table rendering
- Correctly route 'minimax' provider in run_discussion_compression. - Fix MiniMax base URL to api.minimax.io to match main sender. - Refactor read-mode discussion entries to always use a scrollable child with auto-resize. - Remove redundant text wrapping that caused Markdown tables to squash vertically. - Clean up duplicate separators in discussion hub.
This commit is contained in:
@@ -2659,6 +2659,16 @@ def run_discussion_compression(discussion_text: str) -> str:
|
||||
return r.json()["choices"][0]["message"]["content"]
|
||||
except Exception as e:
|
||||
return f"ERROR: DeepSeek compression failed: {e}"
|
||||
elif _provider == "minimax":
|
||||
_ensure_minimax_client()
|
||||
if _minimax_client:
|
||||
resp = _minimax_client.chat.completions.create(
|
||||
model=_model,
|
||||
messages=[{"role": "user", "content": prompt}],
|
||||
temperature=0.0,
|
||||
max_tokens=2048
|
||||
)
|
||||
return resp.choices[0].message.content or ""
|
||||
elif _provider == "gemini_cli":
|
||||
adapter = GeminiCliAdapter(binary_path="gemini")
|
||||
resp_data = adapter.send(prompt, model=_model)
|
||||
|
||||
+4
-6
@@ -3189,8 +3189,6 @@ def render_discussion_entry(app: App, entry: dict, index: int) -> None:
|
||||
draw_list.add_rect_filled(p_min, p_max, imgui.get_color_u32(bg_col), 4.0)
|
||||
draw_list.channels_merge()
|
||||
imgui.separator()
|
||||
imgui.separator()
|
||||
imgui.separator()
|
||||
|
||||
def render_discussion_entry_read_mode(app: App, entry: dict, index: int) -> None:
|
||||
content = entry["content"]
|
||||
@@ -3212,11 +3210,11 @@ def render_discussion_entry_read_mode(app: App, entry: dict, index: int) -> None
|
||||
pattern = re.compile(r"\[Definition: (.*?) from (.*?) \(line (\d+)\)\](\s+```[\s\S]*?```)?")
|
||||
matches, is_nerv = list(pattern.finditer(content)), theme.is_nerv_active()
|
||||
if not matches:
|
||||
with theme.ai_text_style():
|
||||
markdown_helper.render(content, context_id=f'disc_{index}')
|
||||
with imscope.child(f"read_content_{index}", size_x=0, size_y=0, flags=imgui.WindowFlags_.no_scroll_with_mouse | imgui.WindowFlags_.always_auto_resize):
|
||||
with theme.ai_text_style():
|
||||
markdown_helper.render(content, context_id=f'disc_{index}')
|
||||
else:
|
||||
with imscope.child(f"read_content_{index}", size_y=400, flags=True):
|
||||
if app.ui_word_wrap: imgui.push_text_wrap_pos(imgui.get_content_region_avail().x)
|
||||
with imscope.child(f"read_content_{index}", size_x=0, size_y=400, flags=True):
|
||||
last_idx = 0
|
||||
for m_idx, match in enumerate(matches):
|
||||
before = content[last_idx:match.start()]
|
||||
|
||||
Reference in New Issue
Block a user