Skip to content

openrouter tool model support #7

@swayson

Description

@swayson

On Openrouter I filter on those models that have the tag tools.
e.g. openrouter/moonshotai/kimi-k2

I then try and run the quickstart example but get the ValueError.

In [1]: from bespoken import chat
   ...: from bespoken.tools import FileTool
   ...: from bespoken import ui
   ...:
   ...: def set_role():
   ...:     """Set a voice for the assistant"""
   ...:     roles = ["pirate", "teacher", "professor"]
   ...:     role = ui.choice("What role should I take?", roles)
   ...:     return f"You are now speaking like a {role}. Please respond in character for this role."
   ...:
   ...: chat(
   ...:     model_name="openrouter/moonshotai/kimi-k2",
   ...:     tools=[FileTool("README.md")],
   ...:     system_prompt="You are a helpful writing assistant.",
   ...:     debug=False,
   ...:     slash_commands={
   ...:         "/role": set_role,
   ...:     }
   ...: )

/role

ValueError: OpenRouter: openrouter/moonshotai/kimi-k2 does not support tools

It is not entirely clear what models are supported despite the tool tags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions