More bugfixes
This commit is contained in:
18
oai.py
18
oai.py
@@ -313,14 +313,14 @@ Use /help mcp for comprehensive guide with examples.'''
|
||||
'notes': 'Without arguments, shows info for the currently selected model. Displays pricing per million tokens, supported modalities (text, image, etc.), and parameter support.'
|
||||
},
|
||||
'/model': {
|
||||
'description': 'Select or change the AI model for the current session. Shows image and online capabilities.',
|
||||
'description': 'Select or change the AI model for the current session. Shows image, online, and tool capabilities.',
|
||||
'usage': '/model [search_term]',
|
||||
'examples': [
|
||||
('List all models', '/model'),
|
||||
('Search for GPT models', '/model gpt'),
|
||||
('Search for Claude models', '/model claude'),
|
||||
],
|
||||
'notes': 'Models are numbered for easy selection. The table shows Image (✓ if model accepts images) and Online (✓ if model supports web search) columns.'
|
||||
'notes': 'Models are numbered for easy selection. The table shows Image (✓ if model accepts images), Online (✓ if model supports web search), and Tools (✓ if model supports function calling for MCP).'
|
||||
},
|
||||
'/config': {
|
||||
'description': 'View or modify application configuration settings.',
|
||||
@@ -2586,6 +2586,10 @@ def supports_function_calling(model: Dict[str, Any]) -> bool:
|
||||
supported_params = model.get("supported_parameters", [])
|
||||
return "tools" in supported_params or "functions" in supported_params
|
||||
|
||||
def supports_tools(model: Dict[str, Any]) -> bool:
|
||||
"""Check if model supports tools/function calling (same as supports_function_calling)."""
|
||||
return supports_function_calling(model)
|
||||
|
||||
def check_for_updates(current_version: str) -> str:
|
||||
"""Check for updates."""
|
||||
try:
|
||||
@@ -4008,11 +4012,12 @@ def chat():
|
||||
console.print(f"[bold red]No models match '{search_term}'. Try '/model'.[/]")
|
||||
continue
|
||||
|
||||
table = Table("No.", "Name", "ID", "Image", "Online", show_header=True, header_style="bold magenta")
|
||||
table = Table("No.", "Name", "ID", "Image", "Online", "Tools", show_header=True, header_style="bold magenta")
|
||||
for i, model in enumerate(filtered_models, 1):
|
||||
image_support = "[green]✓[/green]" if has_image_capability(model) else "[red]✗[/red]"
|
||||
online_support = "[green]✓[/green]" if supports_online_mode(model) else "[red]✗[/red]"
|
||||
table.add_row(str(i), model["name"], model["id"], image_support, online_support)
|
||||
tools_support = "[green]✓[/green]" if supports_function_calling(model) else "[red]✗[/red]"
|
||||
table.add_row(str(i), model["name"], model["id"], image_support, online_support, tools_support)
|
||||
|
||||
title = f"[bold green]Available Models ({'All' if not search_term else f'Search: {search_term}'})[/]"
|
||||
display_paginated_table(table, title)
|
||||
@@ -4215,11 +4220,12 @@ def chat():
|
||||
console.print(f"[bold red]No models match '{search_term}'. Try without search.[/]")
|
||||
continue
|
||||
|
||||
table = Table("No.", "Name", "ID", "Image", "Online", show_header=True, header_style="bold magenta")
|
||||
table = Table("No.", "Name", "ID", "Image", "Online", "Tools", show_header=True, header_style="bold magenta")
|
||||
for i, model in enumerate(filtered_models, 1):
|
||||
image_support = "[green]✓[/green]" if has_image_capability(model) else "[red]✗[/red]"
|
||||
online_support = "[green]✓[/green]" if supports_online_mode(model) else "[red]✗[/red]"
|
||||
table.add_row(str(i), model["name"], model["id"], image_support, online_support)
|
||||
tools_support = "[green]✓[/green]" if supports_function_calling(model) else "[red]✗[/red]"
|
||||
table.add_row(str(i), model["name"], model["id"], image_support, online_support, tools_support)
|
||||
|
||||
title = f"[bold green]Available Models for Default ({'All' if not search_term else f'Search: {search_term}'})[/]"
|
||||
display_paginated_table(table, title)
|
||||
|
||||
Reference in New Issue
Block a user