fix: use correct model ID 'claude-sonnet-4-5' for Shakespeare AI calls

The model name 'shakespeare' does not exist on the API — it was returning:
  "Model 'shakespeare' is not supported" (400 invalid_request_error)

Updated both sendChatMessage calls in SasquatchGuide and the default
model in useShakespeare hook (sendChatMessage + sendStreamingMessage).

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-06-16 20:05:26 +07:00
parent 4214845d78
commit 2aeb41afdc
2 changed files with 4 additions and 4 deletions

View file

@ -204,7 +204,7 @@ export function SasquatchGuide({ message, onDismiss }: SasquatchGuideProps) {
const firstResponse = await shakespeare.sendChatMessage(
historyWithContext,
'shakespeare'
'claude-sonnet-4-5'
);
const aiText = firstResponse.choices[0]?.message?.content as string ?? '';
@ -254,7 +254,7 @@ export function SasquatchGuide({ message, onDismiss }: SasquatchGuideProps) {
role: 'user' as const,
content: `${SYSTEM_PROMPT}\n\n---\n\nUser asked: ${question}\n\nTool result from ${toolName}:\n${toolResultStr}\n\nNow answer the user's question naturally based on this live data. Be concise and skater-friendly.`,
},
], 'shakespeare');
], 'claude-sonnet-4-5');
accumulated = secondResponse.choices[0]?.message?.content as string ?? '';
} catch (toolErr) {

View file

@ -157,7 +157,7 @@ export function useShakespeare() {
// Chat completion function
const sendChatMessage = useCallback(async (
messages: ChatMessage[],
model: string = 'shakespeare',
model: string = 'claude-sonnet-4-5',
options?: Partial<ChatCompletionRequest>
): Promise<ChatCompletionResponse> => {
if (!user) {
@ -218,7 +218,7 @@ export function useShakespeare() {
// Streaming chat completion function
const sendStreamingMessage = useCallback(async (
messages: ChatMessage[],
model: string = 'shakespeare',
model: string = 'claude-sonnet-4-5',
onChunk: (chunk: string) => void,
options?: Partial<ChatCompletionRequest>
): Promise<void> => {