High severity beginner · Fix: 2-5 min

NotImplementedError

together_ai.exceptions.NotImplementedError

What this error means
Together AI SDK currently does not support function calling; attempts to use this feature result in a NotImplementedError.

Stack trace

traceback
Traceback (most recent call last):
  File "app.py", line 42, in <module>
    response = client.chat.completions.create(
  File "/usr/local/lib/python3.9/site-packages/together_ai/client.py", line 88, in create
    raise NotImplementedError("Function calling is not supported in Together AI SDK")
together_ai.exceptions.NotImplementedError: Function calling is not supported in Together AI SDK
QUICK FIX
Remove function calling parameters from Together AI chat completion calls to avoid the NotImplementedError.

Why it happens

Together AI's Python SDK does not implement the function calling feature available in other LLM providers. When developers try to pass function calling parameters, the SDK raises a NotImplementedError because this capability is not yet supported.

Detection

Detect this error by catching NotImplementedError exceptions from the Together AI client when calling chat completions with function calling parameters, and log the error message for clarity.

Causes & fixes

1

Using function calling parameters with Together AI's chat completion client

✓ Fix

Remove function calling parameters from the request or switch to a provider that supports function calling.

2

Assuming Together AI SDK supports OpenAI-compatible function calling features

✓ Fix

Consult Together AI SDK documentation to confirm supported features before implementation.

Code: broken vs fixed

Broken - triggers the error
python
from together_ai import TogetherAI

client = TogetherAI(api_key=os.environ['TOGETHER_API_KEY'])

response = client.chat.completions.create(
    model="together-large",
    messages=[{"role": "user", "content": "Hello"}],
    functions=[{"name": "get_time", "parameters": {}}],  # This triggers the error
)
print(response)
Fixed - works correctly
python
import os
from together_ai import TogetherAI

client = TogetherAI(api_key=os.environ['TOGETHER_API_KEY'])

response = client.chat.completions.create(
    model="together-large",
    messages=[{"role": "user", "content": "Hello"}]
    # Removed functions parameter to fix NotImplementedError
)
print(response)  # Now works without function calling
Removed the unsupported 'functions' parameter from the chat completion call because Together AI SDK does not support function calling.

Workaround

If function calling is essential, catch the NotImplementedError and fallback to manual prompt engineering to simulate function calls or switch to a provider like OpenAI or Anthropic that supports function calling.

Prevention

Before implementing advanced features like function calling, verify the SDK's feature support in official Together AI documentation to avoid unsupported calls.

Python 3.7+ · together-ai >=0.1.0 · tested on 0.2.0
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.