vendor_connectors.meshy.tools
AI framework tools for Meshy AI 3D generation.
This module provides tools for Meshy AI operations that work with multiple AI agent frameworks. The core functions are framework-agnostic Python functions, with native wrappers for each supported framework.
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”Text3dGenerateSchema | Pydantic schema for the text3d_generate tool. |
|---|---|
Image3dGenerateSchema | Pydantic schema for the image3d_generate tool. |
RigModelSchema | Pydantic schema for the rig_model tool. |
ApplyAnimationSchema | Pydantic schema for the apply_animation tool. |
RetextureModelSchema | Pydantic schema for the retexture_model tool. |
ListAnimationsSchema | Pydantic schema for the list_animations tool. |
CheckTaskStatusSchema | Pydantic schema for the check_task_status tool. |
GetAnimationSchema | Pydantic schema for the get_animation tool. |
Functions
Section titled “Functions”_extract_result_fields | Extract common fields from Meshy API result objects. |
|---|---|
text3d_generate | Generate a 3D model from text description. |
image3d_generate | Generate a 3D model from an image. |
rig_model | Add skeleton/rig to a static 3D model. |
apply_animation | Apply animation to a rigged model. |
retexture_model | Apply new textures to an existing model. |
list_animations | List available animations from the Meshy catalog. |
check_task_status | Check status of a Meshy task. |
get_animation | Get details of a specific animation. |
get_langchain_tools | Get all Meshy tools as LangChain StructuredTools. |
get_crewai_tools | Get all Meshy tools as CrewAI tools. |
get_strands_tools | Get all Meshy tools as plain Python functions for AWS Strands. |
get_tools | Get Meshy tools for the specified or auto-detected framework. |
TOOL_DEFINITIONS |
|---|
class vendor_connectors.meshy.tools.Text3dGenerateSchema
Section titled “class vendor_connectors.meshy.tools.Text3dGenerateSchema”Bases: pydantic.BaseModel
Pydantic schema for the text3d_generate tool.
prompt : str
Section titled “prompt : str”‘Field(…)’
art_style : str
Section titled “art_style : str”‘Field(…)’
negative_prompt : str
Section titled “negative_prompt : str”‘Field(…)’
target_polycount : int
Section titled “target_polycount : int”‘Field(…)’
enable_pbr : bool
Section titled “enable_pbr : bool”‘Field(…)’
class vendor_connectors.meshy.tools.Image3dGenerateSchema
Section titled “class vendor_connectors.meshy.tools.Image3dGenerateSchema”Bases: pydantic.BaseModel
Pydantic schema for the image3d_generate tool.
image_url : str
Section titled “image_url : str”‘Field(…)’
topology : str
Section titled “topology : str”‘Field(…)’
target_polycount : int
Section titled “target_polycount : int”‘Field(…)’
enable_pbr : bool
Section titled “enable_pbr : bool”‘Field(…)’
class vendor_connectors.meshy.tools.RigModelSchema
Section titled “class vendor_connectors.meshy.tools.RigModelSchema”Bases: pydantic.BaseModel
Pydantic schema for the rig_model tool.
model_id : str
Section titled “model_id : str”‘Field(…)’
‘Field(…)’
class vendor_connectors.meshy.tools.ApplyAnimationSchema
Section titled “class vendor_connectors.meshy.tools.ApplyAnimationSchema”Bases: pydantic.BaseModel
Pydantic schema for the apply_animation tool.
model_id : str
Section titled “model_id : str”‘Field(…)’
animation_id : int
Section titled “animation_id : int”‘Field(…)’
‘Field(…)’
class vendor_connectors.meshy.tools.RetextureModelSchema
Section titled “class vendor_connectors.meshy.tools.RetextureModelSchema”Bases: pydantic.BaseModel
Pydantic schema for the retexture_model tool.
model_id : str
Section titled “model_id : str”‘Field(…)’
texture_prompt : str
Section titled “texture_prompt : str”‘Field(…)’
enable_pbr : bool
Section titled “enable_pbr : bool”‘Field(…)’
‘Field(…)’
class vendor_connectors.meshy.tools.ListAnimationsSchema
Section titled “class vendor_connectors.meshy.tools.ListAnimationsSchema”Bases: pydantic.BaseModel
Pydantic schema for the list_animations tool.
category : str
Section titled “category : str”‘Field(…)’
limit : int
Section titled “limit : int”‘Field(…)’
class vendor_connectors.meshy.tools.CheckTaskStatusSchema
Section titled “class vendor_connectors.meshy.tools.CheckTaskStatusSchema”Bases: pydantic.BaseModel
Pydantic schema for the check_task_status tool.
task_id : str
Section titled “task_id : str”‘Field(…)’
task_type : str
Section titled “task_type : str”‘Field(…)’
class vendor_connectors.meshy.tools.GetAnimationSchema
Section titled “class vendor_connectors.meshy.tools.GetAnimationSchema”Bases: pydantic.BaseModel
Pydantic schema for the get_animation tool.
animation_id : int
Section titled “animation_id : int”‘Field(…)’
vendor_connectors.meshy.tools._extract_result_fields(result: object) → dict[str, object]
Section titled “vendor_connectors.meshy.tools._extract_result_fields(result: object) → dict[str, object]”Extract common fields from Meshy API result objects.
Safely extracts status, model_url, and thumbnail_url from result objects, handling missing attributes gracefully.
Args: result: A Meshy API result object (Text3DResult, Image3DResult, etc.)
Returns: Dict with status, model_url, and thumbnail_url fields
vendor_connectors.meshy.tools.text3d_generate(prompt: str, art_style: str = ‘realistic’, negative_prompt: str = ”, target_polycount: int = 30000, enable_pbr: bool = True) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.text3d_generate(prompt: str, art_style: str = ‘realistic’, negative_prompt: str = ”, target_polycount: int = 30000, enable_pbr: bool = True) → dict[str, Any]”Generate a 3D model from text description.
Args: prompt: Detailed text description of the 3D model (max 600 chars) art_style: One of: realistic, sculpture. For ‘sculpture’, set enable_pbr=False as sculpture style generates its own PBR maps. negative_prompt: Things to avoid in the generation target_polycount: Target polygon count enable_pbr: Enable PBR materials. API defaults to False; we default to True for better realistic renders. Set False for sculpture.
Returns: Dict with task_id, status, model_url, and thumbnail_url
vendor_connectors.meshy.tools.image3d_generate(image_url: str, topology: str = ”, target_polycount: int = 15000, enable_pbr: bool = True) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.image3d_generate(image_url: str, topology: str = ”, target_polycount: int = 15000, enable_pbr: bool = True) → dict[str, Any]”Generate a 3D model from an image.
Args: image_url: URL to the source image topology: Mesh topology (“quad” or “triangle”), empty for default target_polycount: Target polygon count enable_pbr: Enable PBR materials
Returns: Dict with task_id, status, model_url, and thumbnail_url
vendor_connectors.meshy.tools.rig_model(model_id: str, wait: bool = True) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.rig_model(model_id: str, wait: bool = True) → dict[str, Any]”Add skeleton/rig to a static 3D model.
Args: model_id: Task ID of the static model to rig wait: Whether to wait for completion (default True)
Returns: Dict with task_id and status
vendor_connectors.meshy.tools.apply_animation(model_id: str, animation_id: int, wait: bool = True) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.apply_animation(model_id: str, animation_id: int, wait: bool = True) → dict[str, Any]”Apply animation to a rigged model.
Args: model_id: Task ID of the rigged model animation_id: Animation ID from the Meshy catalog (integer) wait: Whether to wait for completion (default True)
Returns: Dict with task_id, status, and glb_url
vendor_connectors.meshy.tools.retexture_model(model_id: str, texture_prompt: str, enable_pbr: bool = True, wait: bool = True) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.retexture_model(model_id: str, texture_prompt: str, enable_pbr: bool = True, wait: bool = True) → dict[str, Any]”Apply new textures to an existing model.
Args: model_id: Task ID of the model to retexture texture_prompt: Description of the new texture/appearance enable_pbr: Enable PBR materials wait: Whether to wait for completion (default True)
Returns: Dict with task_id, status, and model_url
vendor_connectors.meshy.tools.list_animations(category: str = ”, limit: int = 50) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.list_animations(category: str = ”, limit: int = 50) → dict[str, Any]”List available animations from the Meshy catalog.
Args: category: Optional category filter (Fighting, WalkAndRun, etc.) limit: Maximum number of results
Returns: Dict with count, total, and list of animations
vendor_connectors.meshy.tools.check_task_status(task_id: str, task_type: str = ‘text-to-3d’) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.check_task_status(task_id: str, task_type: str = ‘text-to-3d’) → dict[str, Any]”Check status of a Meshy task.
Args: task_id: The Meshy task ID task_type: Task type (text-to-3d, rigging, animation, retexture)
Returns: Dict with status, progress, and model_url if complete
vendor_connectors.meshy.tools.get_animation(animation_id: int) → dict[str, Any]
Section titled “vendor_connectors.meshy.tools.get_animation(animation_id: int) → dict[str, Any]”Get details of a specific animation.
Args: animation_id: The animation ID number
Returns: Dict with animation details
vendor_connectors.meshy.tools.TOOL_DEFINITIONS
Section titled “vendor_connectors.meshy.tools.TOOL_DEFINITIONS”None
vendor_connectors.meshy.tools.get_langchain_tools() → list[Any]
Section titled “vendor_connectors.meshy.tools.get_langchain_tools() → list[Any]”Get all Meshy tools as LangChain StructuredTools.
Returns: List of LangChain StructuredTool objects for Meshy operations.
Raises: ImportError: If langchain-core is not installed.
vendor_connectors.meshy.tools.get_crewai_tools() → list[Any]
Section titled “vendor_connectors.meshy.tools.get_crewai_tools() → list[Any]”Get all Meshy tools as CrewAI tools.
Returns: List of CrewAI BaseTool objects for Meshy operations.
Raises: ImportError: If crewai is not installed.
vendor_connectors.meshy.tools.get_strands_tools() → list[Any]
Section titled “vendor_connectors.meshy.tools.get_strands_tools() → list[Any]”Get all Meshy tools as plain Python functions for AWS Strands.
Strands agents work with plain Python functions that have type hints. The functions are returned as-is since they already have proper signatures.
Returns: List of callable functions for Strands agents.
vendor_connectors.meshy.tools.get_tools(framework: str = ‘auto’) → list[Any]
Section titled “vendor_connectors.meshy.tools.get_tools(framework: str = ‘auto’) → list[Any]”Get Meshy tools for the specified or auto-detected framework.
This is the recommended entry point - it auto-detects which AI framework is installed and returns tools in the appropriate format.
Args: framework: Framework to use. Options:
- “auto” (default): Auto-detect based on installed packages
- “langchain”: Force LangChain StructuredTools
- “crewai”: Force CrewAI tools
- “strands”: Force plain functions for Strands
- “functions”: Force plain functions (alias for strands)
Returns: List of tools in the appropriate format for the framework.
Raises: ImportError: If the requested framework is not installed. ValueError: If an unknown framework is specified.
Example:
Auto-detect (recommended)
Section titled “Auto-detect (recommended)”tools = get_tools()
# Force specific frameworktools = get_tools("langchain")tools = get_tools("crewai")