v0.3.0 - Universal Tool Calling & Interactive Documentation
π NexusAI-Client v0.3.0 β Universal Tool Calling & Interactive Documentation
π¦ PyPI Package: https://pypi.org/project/nexusai-client/0.3.0/
π Interactive Documentation: https://nexus-ai-client-doc.vercel.app/
π Integration Guide: INTEGRATION_GUIDE.md
π Highlights of Version 0.3.0
Version 0.3.0 introduces Universal Tool Calling / Function Calling across all 10 supported AI providers, enabling production-grade autonomous agent loops (ReAct) with zero heavy SDK dependencies, along with official integration with our interactive documentation platform.
1. π οΈ Universal Tool Calling (Function Calling)
- Standardized Data Models:
ToolCall,FunctionDefinition,ToolDefinitionadhering to the OpenAI JSON schema standard. - Multi-Turn Agent History: Support for
role="tool",tool_call_id, andtool_callsinChatMessage. - Universal Multi-Provider Protocol Translation:
- OpenAI-Compatible Providers (Groq, Cerebras, Mistral, DeepSeek, Nvidia NIM, OpenRouter, OrcaRouter): Native tool schema forwarding and automated
tool_callsresponse parsing. - Google Gemini REST API: Automatic bi-directional translation to Gemini's
functionDeclarations/toolConfigand parsing offunctionCall/functionResponse. - Cohere V2 REST API: Native tool schema integration and parsing.
- OpenAI-Compatible Providers (Groq, Cerebras, Mistral, DeepSeek, Nvidia NIM, OpenRouter, OrcaRouter): Native tool schema forwarding and automated
- Failover-Safe Tool Calls:
AIGateway.auto_fallback()andFallbackGatewaypreserve all tool definitions during automatic zero-cost failovers.
2. π Interactive Documentation Platform
- Official interactive documentation is now live at https://nexus-ai-client-doc.vercel.app/.
- Added documentation badges and PyPI URL metadata.
3. π§ͺ Comprehensive Test Coverage
- 6 new dedicated test suites covering all tool-calling serialization, execution, multi-turn history, and fallback scenarios.
- 32/32 tests passing (100% pass rate).
π¦ Installation & Upgrade
# With pip
pip install --upgrade nexusai-client
# With uv (Recommended)
uv add --upgrade nexusai-client
# With poetry
poetry add nexusai-client@latestπ‘ Quick Example: Autonomous Agent Loop
import asyncio
import json
from nexusai_client import AIGateway, ChatMessage, FunctionDefinition, ToolDefinition
weather_tool = ToolDefinition(
function=FunctionDefinition(
name="get_weather",
description="Get current temperature and conditions for a given city.",
parameters={
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name, e.g. Tokyo, Paris"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["city"],
},
)
)
async def main():
async with AIGateway.auto_fallback() as client:
messages = [ChatMessage(role="user", content="What is the weather in Tokyo?")]
response = await client.chat(messages=messages, tools=[weather_tool])
if response.has_tool_calls:
# 1. Append assistant tool calls
messages.append(ChatMessage(role="assistant", content=response.text, tool_calls=response.tool_calls))
# 2. Append tool execution result (unified role="tool")
for call in response.tool_calls:
print(f"π§ Tool requested: {call.name} with {call.arguments}")
messages.append(
ChatMessage(
role="tool",
name=call.name,
tool_call_id=call.id,
content=json.dumps({"temperature": 19, "condition": "Clear"}),
)
)
# 3. Get final synthesis
final = await client.chat(messages=messages)
print(f"π€ Final Answer:\n{final.text}")
if __name__ == "__main__":
asyncio.run(main())π Useful Links
- π¦ PyPI Package: https://pypi.org/project/nexusai-client/0.3.0/
- π Interactive Documentation: https://nexus-ai-client-doc.vercel.app/
- π GitHub Repository: https://github.com/laurentvv/NexusAI-Client
- π Integration Guide & Recipes: INTEGRATION_GUIDE.md