feat(dev): /dev/sohbet — danışman sohbeti arayüzü senaryolarla oynatılır
All checks were successful
Deploy / deploy (push) Successful in 6m43s
All checks were successful
Deploy / deploy (push) Successful in 6m43s
Model, oturum ve kredi harcamadan sohbet arayüzünü denemek için yalnız geliştirmede açılan sayfa (üretimde 404, noindex). Beş hazır senaryo: tek araç, art arda araçlar, düzeltme notu, akış hatası, uzun geçmiş. - SohbetClient'a denemeTransport prop'u: verilirse /api/soru yerine önceden yazılmış akış oynar; üretim yüzeyleri bunu vermez. - @shadcn/helpers/ai-sdk sahte taşıyıcı için eklendi; dinamik import NODE_ENV dalında kaldığından üretim paketine girmez. - cagri.ts: kullanılmayan OpenAI tip import'u kaldırıldı. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useChat } from "@ai-sdk/react";
|
||||
import { DefaultChatTransport, type UIMessage } from "ai";
|
||||
import { DefaultChatTransport, type ChatTransport, type UIMessage } from "ai";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Image from "next/image";
|
||||
@@ -227,6 +227,7 @@ export function SohbetClient({
|
||||
ilkYorum,
|
||||
bildikleri,
|
||||
initialProfil,
|
||||
denemeTransport,
|
||||
}: {
|
||||
baslangicKredi: number;
|
||||
/** Sunucu tarafında çekilmiş danışman profili; verilirse mount fetch'i atlanır */
|
||||
@@ -244,6 +245,9 @@ export function SohbetClient({
|
||||
/** Danışmanın prompt'unda gerçekten yer alan bağlam maddeleri; başlıktaki
|
||||
* "Danışmanın bildikleri" ipucunda listelenir. Boşsa ipucu çizilmez. */
|
||||
bildikleri?: string[];
|
||||
/** Yalnız /dev/sohbet: /api/soru yerine önceden yazılmış senaryoyu oynatır
|
||||
* (model, oturum ve kredi yok). Üretim yüzeyleri bunu vermez. */
|
||||
denemeTransport?: ChatTransport<UIMessage>;
|
||||
}) {
|
||||
const [girdi, setGirdi] = useState("");
|
||||
const [yuklendi, setYuklendi] = useState(initialMesajlar != null);
|
||||
@@ -270,7 +274,7 @@ export function SohbetClient({
|
||||
if (krediDustu) setKredi((k) => k - 1);
|
||||
}),
|
||||
);
|
||||
const { transport } = kanal;
|
||||
const transport = denemeTransport ?? kanal.transport;
|
||||
|
||||
const {
|
||||
messages: mesajlar,
|
||||
|
||||
Reference in New Issue
Block a user