Skip to content

Commit ddc099e

Browse files
jxnlclaude
andcommitted
Fix xAI provider model name parsing in from_provider()
Remove incorrect model name split that was causing ValueError when using xAI provider through from_provider() function. The model_name is already extracted from the initial provider/model split. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 22a5bdc commit ddc099e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

instructor/auto_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,10 @@ def from_provider(
456456

457457
client = AsyncClient() if async_client else SyncClient()
458458
return from_xai(
459-
client, mode=mode if mode else instructor.Mode.JSON, **kwargs
459+
client,
460+
mode=mode if mode else instructor.Mode.JSON,
461+
model=model_name,
462+
**kwargs,
460463
)
461464
except ImportError:
462465
from instructor.exceptions import ConfigurationError

0 commit comments

Comments
 (0)