المساعدة

بيانات البيانات

assistant.data → object

تشكيل الجلسة كجسم عادي: ما الذي يجب تخزينه، ماذا يجب أن يتم تسجيله، ما الذي يجب تسليمه لصفحة.

a property, not a callno networka snapshot
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

ما الذي يحمله

assistant.data;
// {
//   id, model, settings, schema, memory,
//   title, createdAt, updatedAt
// }
assistant.data
# {
#   "id", "model", "settings", "schema", "memory",
#   "title", "createdAt", "updatedAt"
# }

نفس القيم التي تجلس على الجسم نفسه، تجتمع في واحد، وقراءتها لا تمس شيئا - ليس هناك طلب، ولا تكلفة.

سبب وجوده

لأن الجسم يحمل طرقاً وعميلاً، ومعظم الوقت ما تريده هو الجزء الذي يمكنك تخزينه أو إرساله أو طبعه.

// To your own database
await db.sessions.insert({ userId, ...assistant.data });

// To a page — nothing here is a secret
return Response.json({ session: assistant.data });

// To a log that stays readable
console.log("session", assistant.data.id, assistant.data.model);
# To your own database
db.sessions.insert({"userId": user_id, **assistant.data})

# To a page — nothing here is a secret (Flask)
return jsonify(session=assistant.data)

# To a log that stays readable
print("session", assistant.data["id"], assistant.data["model"])
لا يوجد مفتاح ولا دليل في ذلك

وهذا ما يجعل من الآمن إرسالها إلى واجهة - على عكس العميل الذي أنتجها.

إنها لمحة، وليست نظرة حية

The values are what the SDK was told when the session was opened or fetched. Generating does not refresh them in place — title and updatedAt move on the server while your copy stays as it was.

const assistant = await api.models.create({ model: "gemini-3.5-flash" });
assistant.data.title;        // ""

await assistant.generate({ inputs: [{ type: "text", content: "Résume ce contrat." }] });
assistant.data.title;        // still "" — your copy did not move

const fresh = await api.models.get(assistant.id);
fresh.data.title;            // "Résume ce contrat."
assistant = api.models.create(model="gemini-3.5-flash")
assistant.data["title"]      # ""

assistant.generate(inputs=[{"type": "text", "content": "Résume ce contrat."}])
assistant.data["title"]      # still "" — your copy did not move

fresh = api.models.get(assistant.id)
fresh.data["title"]          # "Résume ce contrat."
إعادة قراءة قبل عرضها

A قائمة مبنِّى من بوصة ذاكرة المعارض و بناء الإيطالية من api.models.list()أو أن تحضروا الدورة مرة أخرى - كلاهما حر.

:: عقد دورتين

مقارنة بال idمقبضين لنفس المحادثة هما نفس المحادثة مهما كان الفرق بين اللقطتين