ใช้การกําหนดค่าโมเดลเพื่อควบคุมคําตอบ

ในการเรียกใช้โมเดลแต่ละครั้ง คุณสามารถส่งการกำหนดค่าโมเดลเพื่อควบคุมวิธีที่โมเดลสร้างคำตอบได้ แต่ละรุ่นมีตัวเลือกการกำหนดค่าที่แตกต่างกัน

นอกจากนี้ คุณยังทดลองใช้พรอมต์และการกำหนดค่าโมเดลได้โดยใช้ Google AI Studio

ไปที่Gemini ตัวเลือกการกำหนดค่า ไปที่Imagen ตัวเลือกการกำหนดค่า



กำหนดค่าโมเดล Gemini

คลิกผู้ให้บริการ Gemini API เพื่อดูเนื้อหาและโค้ดของผู้ให้บริการรายนั้นๆ ในหน้านี้

ส่วนนี้จะแสดงวิธี ตั้งค่าการกำหนดค่าเพื่อใช้กับ โมเดล Gemini และอธิบายพารามิเตอร์แต่ละรายการ

ตั้งค่าโมเดล (Gemini)

กำหนดค่าสำหรับกรณีการใช้งานทั่วไป

ระบบจะรักษาการกำหนดค่าไว้ตลอดอายุการใช้งานของอินสแตนซ์ หากต้องการใช้การกำหนดค่าอื่น ให้สร้างอินสแตนซ์ GenerativeModel ใหม่ด้วยการกำหนดค่านั้น

Swift

ตั้งค่าพารามิเตอร์ใน GenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ GenerativeModel


import FirebaseAI

// Set parameter values in a `GenerationConfig`.
// IMPORTANT: Example values shown here. Make sure to update for your use case.
let config = GenerationConfig(
  candidateCount: 1,
  temperature: 0.9,
  topP: 0.1,
  topK: 16,
  maxOutputTokens: 200,
  stopSequences: ["red"]
)

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `GenerativeModel` instance
let model = FirebaseAI.firebaseAI(backend: .googleAI()).generativeModel(
  modelName: "GEMINI_MODEL_NAME",
  generationConfig: config
)

// ...

Kotlin

ตั้งค่าพารามิเตอร์ใน GenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ GenerativeModel


// ...

// Set parameter values in a `GenerationConfig`.
// IMPORTANT: Example values shown here. Make sure to update for your use case.
val config = generationConfig {
    candidateCount = 1
    maxOutputTokens = 200
    stopSequences = listOf("red")
    temperature = 0.9f
    topK = 16
    topP = 0.1f
}

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `GenerativeModel` instance
val model = Firebase.ai(backend = GenerativeBackend.googleAI()).generativeModel(
    modelName = "GEMINI_MODEL_NAME",
    generationConfig = config
)

// ...

Java

ตั้งค่าพารามิเตอร์ใน GenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ GenerativeModel


// ...

// Set parameter values in a `GenerationConfig`.
// IMPORTANT: Example values shown here. Make sure to update for your use case.
GenerationConfig.Builder configBuilder = new GenerationConfig.Builder();
configBuilder.candidateCount = 1;
configBuilder.maxOutputTokens = 200;
configBuilder.stopSequences = List.of("red");
configBuilder.temperature = 0.9f;
configBuilder.topK = 16;
configBuilder.topP = 0.1f;

GenerationConfig config = configBuilder.build();

// Specify the config as part of creating the `GenerativeModel` instance
GenerativeModelFutures model = GenerativeModelFutures.from(
        FirebaseAI.getInstance(GenerativeBackend.googleAI())
                .generativeModel(
                    "GEMINI_MODEL_NAME",
                    config
                );
);

// ...

Web

ตั้งค่าพารามิเตอร์ใน GenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ GenerativeModel


// ...

// Initialize the Gemini Developer API backend service
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });

// Set parameter values in a `GenerationConfig`.
// IMPORTANT: Example values shown here. Make sure to update for your use case.
const generationConfig = {
  candidate_count: 1,
  maxOutputTokens: 200,
  stopSequences: ["red"],
  temperature: 0.9,
  topP: 0.1,
  topK: 16,
};

// Specify the config as part of creating the `GenerativeModel` instance
const model = getGenerativeModel(ai, { model: "GEMINI_MODEL_NAME",  generationConfig });

// ...

Dart

ตั้งค่าพารามิเตอร์ใน GenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ GenerativeModel


// ...

// Set parameter values in a `GenerationConfig`.
// IMPORTANT: Example values shown here. Make sure to update for your use case.
final generationConfig = GenerationConfig(
  candidateCount: 1,
  maxOutputTokens: 200,
  stopSequences: ["red"],
  temperature: 0.9,
  topP: 0.1,
  topK: 16,
);

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `GenerativeModel` instance
final model = FirebaseAI.googleAI().generativeModel(
  model: 'GEMINI_MODEL_NAME',
  config: generationConfig,
);

// ...

Unity

ตั้งค่าพารามิเตอร์ใน GenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ GenerativeModel


// ...

// Set parameter values in a `GenerationConfig`.
// IMPORTANT: Example values shown here. Make sure to update for your use case.
var generationConfig = new GenerationConfig(
  candidateCount: 1,
  maxOutputTokens: 200,
  stopSequences: new string[] { "red" },
  temperature: 0.9f,
  topK: 16,
  topP: 0.1f
);

// Specify the config as part of creating the `GenerativeModel` instance
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());
var model = ai.GetGenerativeModel(
  modelName: "GEMINI_MODEL_NAME",
  generationConfig: generationConfig
);

คุณดูคำอธิบายของแต่ละพารามิเตอร์ได้ ในส่วนถัดไปของหน้านี้

การกำหนดค่าสำหรับ Gemini Live API

ระบบจะรักษาการกำหนดค่าไว้ตลอดอายุการใช้งานของอินสแตนซ์ หากต้องการใช้การกำหนดค่าอื่น ให้สร้างอินสแตนซ์ LiveModel ใหม่ด้วยการกำหนดค่านั้น

Swift

ระบบยังไม่รองรับ Live API สำหรับแอปแพลตฟอร์ม Apple แต่โปรดกลับมาตรวจสอบอีกครั้งในเร็วๆ นี้

Kotlin

ตั้งค่าพารามิเตอร์ใน LiveGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ LiveModel


// ...

// Set parameter values in a `LiveGenerationConfig` (example values shown here)
val config = liveGenerationConfig {
    maxOutputTokens = 200
    responseModality = ResponseModality.AUDIO
    speechConfig = SpeechConfig(voice = Voices.FENRIR)
    temperature = 0.9f
    topK = 16
    topP = 0.1f
}

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `LiveModel` instance
val model = Firebase.ai(backend = GenerativeBackend.googleAI()).liveModel(
    modelName = "GEMINI_MODEL_NAME",
    generationConfig = config
)

// ...

Java

ตั้งค่าพารามิเตอร์ใน LiveGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ LiveModel


// ...

// Set parameter values in a `LiveGenerationConfig` (example values shown here)
LiveGenerationConfig.Builder configBuilder = new LiveGenerationConfig.Builder();
configBuilder.setMaxOutputTokens(200);
configBuilder.setResponseModalities(ResponseModality.AUDIO);

configBuilder.setSpeechConfig(new SpeechConfig(Voices.FENRIR));
configBuilder.setTemperature(0.9f);
configBuilder.setTopK(16);
configBuilder.setTopP(0.1f);

LiveGenerationConfig config = configBuilder.build();

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `LiveModel` instance
LiveModelFutures model = LiveModelFutures.from(
        FirebaseAI.getInstance(GenerativeBackend.googleAI())
                .generativeModel(
                    "GEMINI_MODEL_NAME",
                    config
                );
);

// ...

Web

ตั้งค่าพารามิเตอร์ใน LiveGenerationConfig ระหว่างการเริ่มต้นอินสแตนซ์ LiveGenerativeModel


// ...

// Initialize the Gemini Developer API backend service
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });

// Set parameter values in a `LiveGenerationConfig` (example values shown here)
const generationConfig = {
  maxOutputTokens: 200,
  responseModalities: [ResponseModality.AUDIO],
  speechConfig: {
    voiceConfig: {
      prebuiltVoiceConfig: { voiceName: "Fenrir" },
    },
  },
  temperature: 0.9,
  topP: 0.1,
  topK: 16,
};

// Specify the config as part of creating the `LiveGenerativeModel` instance
const model = getLiveGenerativeModel(ai, {
  model: "GEMINI_MODEL_NAME",
  generationConfig,
});

// ...

Dart

ตั้งค่าพารามิเตอร์ใน LiveGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ LiveModel



// ...

// Set parameter values in a `LiveGenerationConfig` (example values shown here)
final generationConfig = LiveGenerationConfig(
  maxOutputTokens: 200,
  responseModalities: [ResponseModality.audio],
  speechConfig: SpeechConfig(voiceName: 'Fenrir'),
  temperature: 0.9,
  topP: 0.1,
  topK: 16,
);

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `LiveModel` instance
final model = FirebaseAI.googleAI().liveModel(
  model: 'GEMINI_MODEL_NAME',
  config: generationConfig,
);

// ...

Unity

ตั้งค่าพารามิเตอร์ใน LiveGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ LiveModel


// ...

// Set parameter values in a `LiveGenerationConfig` (example values shown here)
var liveGenerationConfig = new LiveGenerationConfig(
  maxOutputTokens: 200,
  responseModalities: new [] { ResponseModality.Audio },
  speechConfig: SpeechConfig.UsePrebuiltVoice("Fenrir"),
  temperature: 0.9f,
  topK: 16,
  topP: 0.1f
);

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `LiveModel` instance
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());
var model = ai.GetLiveModel(
  modelName: "GEMINI_MODEL_NAME",
  liveGenerationConfig: liveGenerationConfig
);

คุณดูคำอธิบายของแต่ละพารามิเตอร์ได้ ในส่วนถัดไปของหน้านี้

คำอธิบายพารามิเตอร์ (Gemini)

ภาพรวมระดับสูงของพารามิเตอร์ที่ใช้ได้มีดังนี้ คุณดูรายการพารามิเตอร์และค่าของพารามิเตอร์ทั้งหมด ได้ในเอกสารประกอบของ Gemini Developer API

พารามิเตอร์ คำอธิบาย ค่าเริ่มต้น
การประทับเวลาเสียง
audioTimestamp

บูลีนที่ช่วยให้ระบบเข้าใจการประทับเวลาสำหรับไฟล์อินพุตเสียงเท่านั้น

ใช้ได้เฉพาะเมื่อใช้การโทร generateContent หรือ generateContentStream และประเภทอินพุตเป็น ไฟล์เสียงเท่านั้น

false
จำนวนผู้สมัคร
candidateCount

ระบุจำนวนรูปแบบการตอบกลับที่จะแสดง สำหรับคำขอแต่ละรายการ ระบบจะเรียกเก็บเงินจากคุณสำหรับโทเค็นเอาต์พุตของผู้สมัครรับเลือกทั้งหมด แต่จะเรียกเก็บเงินจากคุณเพียงครั้งเดียวสำหรับโทเค็นอินพุต

ค่าที่รองรับ: 1 - 8 (รวมทุกค่าในช่วง)

ใช้ได้เฉพาะเมื่อใช้ generateContent และ โมเดล Gemini ล่าสุด ไม่รองรับโมเดล Live API และ generateContentStream

1
ค่าปรับความถี่
frequencyPenalty
ควบคุมความน่าจะเป็นของการรวมโทเค็นที่ปรากฏซ้ำๆ ใน คำตอบที่สร้างขึ้น
ค่าบวกจะลงโทษโทเค็นที่ปรากฏซ้ำๆ ในเนื้อหาที่สร้างขึ้น ซึ่งจะลดความน่าจะเป็นของการทำเนื้อหาซ้ำ
---
โทเค็นเอาต์พุตสูงสุด
maxOutputTokens
ระบุจำนวนโทเค็นสูงสุดที่สร้างได้ใน การตอบกลับ ---
การลงโทษกรณีไม่พร้อม
presencePenalty
ควบคุมความน่าจะเป็นของการรวมโทเค็นที่ปรากฏใน คำตอบที่สร้างขึ้นแล้ว
ค่าบวกจะลงโทษโทเค็นที่ปรากฏในเนื้อหาที่สร้างขึ้นแล้ว ซึ่งจะเพิ่มโอกาสในการสร้างเนื้อหาที่หลากหลายมากขึ้น
---
หยุดลำดับ
stopSequences

ระบุรายการสตริงที่บอกให้โมเดลหยุดสร้างเนื้อหาหากพบสตริงใดสตริงหนึ่งในคำตอบ

ใช้ได้เฉพาะเมื่อใช้การกำหนดค่า GenerativeModel

---
อุณหภูมิ
temperature
ควบคุมระดับความสุ่มในคำตอบ
อุณหภูมิที่ต่ำลงจะทำให้ได้คำตอบที่แน่นอนมากขึ้น และอุณหภูมิที่สูงขึ้น จะทำให้ได้คำตอบที่หลากหลายหรือสร้างสรรค์มากขึ้น
ขึ้นอยู่กับรุ่น
Top-K
topK
จำกัดจำนวนคำที่มีความเป็นไปได้สูงสุดที่ใช้ใน เนื้อหาที่สร้างขึ้น
ค่า Top-K ที่ 1 หมายความว่าโทเค็นถัดไปที่เลือกควรเป็น โทเค็นที่มีแนวโน้มมากที่สุดในบรรดาโทเค็นทั้งหมดในคำศัพท์ของโมเดล ขณะที่ค่า Top-K ที่ n หมายความว่าโทเค็นถัดไปควร เลือกจากโทเค็นที่มีแนวโน้มมากที่สุด (ทั้งหมดขึ้นอยู่กับอุณหภูมิที่ตั้งไว้)
ขึ้นอยู่กับรุ่น
Top-P
topP
ควบคุมความหลากหลายของเนื้อหาที่สร้างขึ้น
ระบบจะเลือกโทเค็นจากโทเค็นที่มีแนวโน้มมากที่สุด (ดูที่ top-K ด้านบน) ไปจนถึงโทเค็นที่มี แนวโน้มน้อยที่สุดจนกว่าผลรวมของความน่าจะเป็นจะเท่ากับค่า top-P
ขึ้นอยู่กับรุ่น
รูปแบบการตอบกลับ
responseModality

ระบุประเภทเอาต์พุตที่สตรีมเมื่อใช้ Live API หรือเอาต์พุตหลายรูปแบบดั้งเดิมโดยโมเดล Gemini เช่น ข้อความ เสียง หรือรูปภาพ

ใช้ได้เฉพาะเมื่อใช้ Live API และการกำหนดค่า LiveModel หรือเมื่อใช้โมเดล Gemini ที่สามารถแสดงผลแบบมัลติโมดัล

---
คำพูด (เสียง)
speechConfig

ระบุเสียงที่ใช้สำหรับเอาต์พุตเสียงที่สตรีมเมื่อใช้ Live API

ใช้ได้เฉพาะเมื่อใช้การกำหนดค่า Live API และ LiveModel

Puck



กำหนดค่าโมเดล Imagen

คลิกผู้ให้บริการ Imagen API เพื่อดูเนื้อหาและโค้ดของผู้ให้บริการรายนั้นๆ ในหน้านี้

ส่วนนี้จะแสดงวิธี ตั้งค่าการกำหนดค่าเพื่อใช้กับ โมเดล Imagen และอธิบายพารามิเตอร์แต่ละรายการ

ตั้งค่าโมเดล (Imagen)

ระบบจะรักษาการกำหนดค่าไว้ตลอดอายุการใช้งานของอินสแตนซ์ หากต้องการใช้การกำหนดค่าอื่น ให้สร้างอินสแตนซ์ ImagenModel ใหม่ด้วยการกำหนดค่านั้น

Swift

ตั้งค่าพารามิเตอร์ใน ImagenGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ ImagenModel


import FirebaseAI

// Set parameter values in a `ImagenGenerationConfig` (example values shown here)
let config = ImagenGenerationConfig(
  negativePrompt: "frogs",
  numberOfImages: 2,
  aspectRatio: .landscape16x9,
  imageFormat: .jpeg(compressionQuality: 100),
  addWatermark: false
)

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `ImagenModel` instance
let model = FirebaseAI.firebaseAI(backend: .googleAI()).imagenModel(
  modelName: "IMAGEN_MODEL_NAME",
  generationConfig: config
)

// ...

Kotlin

ตั้งค่าพารามิเตอร์ใน ImagenGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ ImagenModel


// ...

// Set parameter values in a `ImagenGenerationConfig` (example values shown here)
val config = ImagenGenerationConfig {
    negativePrompt = "frogs",
    numberOfImages = 2,
    aspectRatio = ImagenAspectRatio.LANDSCAPE_16x9,
    imageFormat = ImagenImageFormat.jpeg(compressionQuality = 100),
    addWatermark = false
}

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `GenerativeModel` instance
val model = Firebase.ai(backend = GenerativeBackend.vertexAI()).imagenModel(
    modelName = "IMAGEN_MODEL_NAME",
    generationConfig = config
)

// ...

Java

ตั้งค่าพารามิเตอร์ใน ImagenGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ ImagenModel


// ...

// Set parameter values in a `ImagenGenerationConfig` (example values shown here)
ImagenGenerationConfig config = new ImagenGenerationConfig.Builder()
    .setNegativePrompt("frogs")
    .setNumberOfImages(2)
    .setAspectRatio(ImagenAspectRatio.LANDSCAPE_16x9)
    .setImageFormat(ImagenImageFormat.jpeg(100))
    .setAddWatermark(false)
    .build();

// Specify the config as part of creating the `ImagenModel` instance
ImagenModelFutures model = ImagenModelFutures.from(
        FirebaseAI.getInstance(GenerativeBackend.googleAI())
                .imagenModel(
                    "IMAGEN_MODEL_NAME",
                    config
                );
);

// ...

Web

ตั้งค่าพารามิเตอร์ใน ImagenGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ ImagenModel


// ...

// Initialize the Gemini Developer API backend service
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });

// Set parameter values in a `ImagenGenerationConfig` (example values shown here)
const generationConfig = {
  negativePrompt: "frogs",
  numberOfImages: 2,
  aspectRatio: ImagenAspectRatio.LANDSCAPE_16x9,
  imageFormat: ImagenImageFormat.jpeg(100),
  addWatermark: false
};

// Specify the config as part of creating the `ImagenModel` instance
const model = getImagenModel(ai, { model: "IMAGEN_MODEL_NAME", generationConfig });

// ...

Dart

ตั้งค่าพารามิเตอร์ใน ImagenGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ ImagenModel


// ...

// Set parameter values in a `ImagenGenerationConfig` (example values shown here)
final generationConfig = ImagenGenerationConfig(
  negativePrompt: 'frogs',
  numberOfImages: 2,
  aspectRatio: ImagenAspectRatio.landscape16x9,
  imageFormat: ImagenImageFormat.jpeg(compressionQuality: 100)
  addWatermark: false
);

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `ImagenModel` instance
final model = FirebaseAI.googleAI().imagenModel(
  model: 'IMAGEN_MODEL_NAME',
  config: generationConfig,
);

// ...

Unity

ตั้งค่าพารามิเตอร์ใน ImagenGenerationConfig เป็นส่วนหนึ่งของการสร้างอินสแตนซ์ ImagenModel


using Firebase.AI;

// Set parameter values in a `ImagenGenerationConfig` (example values shown here)
var config = new ImagenGenerationConfig(
  numberOfImages: 2,
  aspectRatio: ImagenAspectRatio.Landscape16x9,
  imageFormat: ImagenImageFormat.Jpeg(100)
);

// Initialize the Gemini Developer API backend service
// Specify the config as part of creating the `ImagenModel` instance
var model = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI()).GetImagenModel(
  modelName: "imagen-4.0-generate-001",
  generationConfig: config
);

// ...

คุณดูคำอธิบายของแต่ละพารามิเตอร์ได้ ในส่วนถัดไปของหน้านี้

คำอธิบายพารามิเตอร์ (Imagen)

ภาพรวมระดับสูงของพารามิเตอร์ที่ใช้ได้มีดังนี้ ดูรายการพารามิเตอร์และค่าต่างๆ โดยละเอียดได้ในเอกสารประกอบของ Google Cloud

พารามิเตอร์ คำอธิบาย ค่าเริ่มต้น
พรอมต์เชิงลบ
negativePrompt
คำอธิบายของสิ่งที่คุณต้องการละเว้นในรูปภาพที่สร้างขึ้น

imagen-3.0-generate-002 ยังไม่รองรับพารามิเตอร์นี้

---
จำนวนผลลัพธ์
numberOfImages
จำนวนรูปภาพที่สร้างขึ้นซึ่งแสดงผลสำหรับแต่ละคำขอ ค่าเริ่มต้นคือ 1 รูปภาพ
สัดส่วนภาพ
aspectRatio
อัตราส่วนความกว้างต่อความสูงของรูปภาพที่สร้างขึ้น ค่าเริ่มต้นคือสี่เหลี่ยมจัตุรัส (1:1)
รูปแบบรูปภาพ
imageFormat
ตัวเลือกเอาต์พุต เช่น รูปแบบรูปภาพ (ประเภท MIME) และระดับ การบีบอัดของรูปภาพที่สร้างขึ้น ประเภท MIME เริ่มต้นคือ PNG
การบีบอัดเริ่มต้นคือ 75 (หากตั้งค่าประเภท MIME เป็น JPEG)
ลายน้ำ
addWatermark
เลือกว่าจะเพิ่มลายน้ำดิจิทัลที่มองไม่เห็น (เรียกว่า SynthID) ลงในรูปภาพที่สร้างขึ้นหรือไม่ ค่าเริ่มต้นคือ true
การสร้างบุคคล
personGeneration
จะอนุญาตให้โมเดลสร้างรูปภาพบุคคลหรือไม่ ค่าเริ่มต้นขึ้นอยู่กับรุ่น



ตัวเลือกอื่นๆ ในการควบคุมการสร้างเนื้อหา

  • ดูข้อมูลเพิ่มเติมเกี่ยวกับการออกแบบพรอมต์ เพื่อให้คุณมีอิทธิพลต่อโมเดลในการสร้างเอาต์พุตที่เฉพาะเจาะจงตามความต้องการของคุณ
  • ใช้การตั้งค่าความปลอดภัย เพื่อปรับความน่าจะเป็นที่จะได้รับคำตอบที่อาจถือว่า เป็นอันตราย ซึ่งรวมถึงวาจาสร้างความเกลียดชังและเนื้อหาเกี่ยวกับเรื่องเพศอย่างโจ่งแจ้ง
  • ตั้งคำสั่งของระบบ เพื่อกำหนดลักษณะการทำงานของโมเดล ฟีเจอร์นี้เป็นเหมือนคำนำที่คุณ เพิ่มก่อนที่โมเดลจะได้รับคำสั่งเพิ่มเติมจากผู้ใช้ปลายทาง
  • ส่งสคีมาการตอบกลับ พร้อมกับพรอมต์เพื่อระบุสคีมาเอาต์พุตที่เฉพาะเจาะจง โดยส่วนใหญ่จะใช้ฟีเจอร์นี้เมื่อสร้างเอาต์พุต JSON แต่ก็ใช้กับงานการจัดประเภทได้เช่นกัน (เช่น เมื่อคุณต้องการให้โมเดลใช้ป้ายกำกับหรือแท็กที่เฉพาะเจาะจง)