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.template1.1 Before
The
templateis a string w/ or w/o variables1.2 Now
The
templateis 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
templatekey2.2 Scenario 2: Continue a chat with previous context
3. API Alternatives
3.1 Option A: same structure as orchestration service
promptwill be passed as orchestrationtemplating_module_config.templatemessage_historywill be passed as orchestrationtemplating_module_config.messages_historyScenario 1
Scenario 2
prompt3.2 Option B: Put everything (last prompt + history) into one array
templating_module_config.templatetemplating_module_config.messages_historyScenario 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