API Design: Prompt templating #30
Closed
jjtang1985
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We want to have the alignment of SDK API design for the prompt templating module of the orchestration service.
1. Background
Orchestration service changed their spec for
templating_module_config.template
1.1 Before
The
template
is a string w/ or w/o variables1.2 Now
The
template
is an array of object2. Reason of the change
There are two major scenarios, where the scenario 1 needs an array:
2.1 Scenario 1: Start a chat
template
key2.2 Scenario 2: Continue a chat with previous context
3. API Alternatives
3.1 Option A: same structure as orchestration service
prompt
will be passed as orchestrationtemplating_module_config.template
message_history
will be passed as orchestrationtemplating_module_config.messages_history
Scenario 1
Scenario 2
prompt
3.2 Option B: Put everything (last prompt + history) into one array
templating_module_config.template
templating_module_config.messages_history
Scenario 1
Scenario 2
Appendix
Orchestration merges the info in the following order:
messages = [].append(message_history)
prompt = template.replace(placeholder, value)
messages = messages.append(prompt)
source code
Beta Was this translation helpful? Give feedback.
All reactions