Skip to content

Commit eecf8a5

Browse files
MediaPipe Teamcopybara-github
MediaPipe Team
authored andcommitted
No public description
PiperOrigin-RevId: 732337342
1 parent e9460ad commit eecf8a5

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

mediapipe/tasks/cc/genai/inference/proto/llm_params.proto

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ message LlmParameters {
8484

8585
repeated InputOutputNormalization input_output_normalizations = 7;
8686

87-
PromptTemplate prompt_template = 8;
87+
PromptTemplate prompt_template = 8 [deprecated = true];
88+
89+
// Prompt templates for different roles.
90+
optional PromptTemplates prompt_templates = 17;
8891

8992
// Number of tokens to draft in a single step when using speculative decoding.
9093
optional int32 num_draft_tokens = 9;

mediapipe/tasks/cc/genai/inference/proto/prompt_template.proto

+27-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ option java_outer_classname = "PromptTemplateProto";
3131
message PromptTemplate {
3232
// Text prepended to session's context on the first prefill invocation. This
3333
// is useful for system prompts.
34-
string session_prefix = 1;
34+
string session_prefix = 1 [deprecated = true];
3535

3636
// Text prepended to the input prompt on the first chunck of the prefill call.
3737
// This is useful for adding start of user's turn markers.
@@ -41,3 +41,29 @@ message PromptTemplate {
4141
// for adding start of model of model's turn markers.
4242
string prompt_suffix = 3;
4343
}
44+
45+
// A collection of prompt templates for different roles.
46+
// Here is an example of the template based on Gemma's specifications here:
47+
// https://ai.google.dev/gemma/docs/formatting
48+
//
49+
// message prompt_templates {
50+
// .user_template = {
51+
// .prompt_prefix = "<start_of_turn>user\n";
52+
// .prompt_suffix = "<end_of_turn>\n";
53+
// }
54+
// .model_template = {
55+
// .prompt_prefix = "<start_of_turn>model\n ";
56+
// .prompt_suffix = "<end_of_turn>\n";
57+
// }
58+
// }
59+
//
60+
message PromptTemplates {
61+
// The template for user role.
62+
optional PromptTemplate user_template = 1;
63+
64+
// The template for model role.
65+
optional PromptTemplate model_template = 2;
66+
67+
// The template for system role.
68+
optional PromptTemplate system_template = 3;
69+
}

0 commit comments

Comments
 (0)