You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we need to pass the prompt_params along with a given request object like we do in claude2_request.
...
messages= [
{"role": "user", "content": "Write me a short poem"},
]
prompt_params=GenerationParams(messages=messages)
claude2_request=ModelGenerationRequest(
model_name=ModelsEnum.CLAUDE_INSTANT_12,
provider_name=ProvidersEnum.ANTHROPIC.value,
order=1,
prompt_params=prompt_params,
)
...
While we can possibly update the prompt_params later on by passing a new value by:
claude2_request.prompt_params=new_prompt_params
This makes it a dirty and implicit way of passing messages to the context.
Proposal
Update client.generate to accept prompt_params or messages separately ( assuming that prompt_params are model agnostic ).
Hence the following snippet would look like this:
Messages are decoupled from Model Request Objects and hence reusing them would be easier, ie one can generate multiple request objects and create a configuration of their request objects and reuse them with the same messages.
claude2_request_prio=ModelGenerationRequest(...)
claude_request_prio=ModelGenerationRequest(...)
openapi_request_non_prio=ModelGenerationRequest(...)
# Generation Request lists that can be reused as per requirementmain_generation_request_list= [
claude2_request_prio,
claude_request_prio,
openapi_request_non_prio
]
...
# Generation request list is passed to `client.generate()` when a message is receivedresponse=client.generate(ordered_generation_requests=main_generation_request_list, messages=prompt_params)
The text was updated successfully, but these errors were encountered:
unownone
changed the title
Unboun
Unbound prompt_params or messages from model_request objects for better reusing.
Dec 14, 2023
Summary
Currently we need to pass the
prompt_params
along with a given request object like we do inclaude2_request
.While we can possibly update the
prompt_params
later on by passing a new value by:This makes it a dirty and implicit way of passing messages to the context.
Proposal
Update
client.generate
to acceptprompt_params
ormessages
separately ( assuming that prompt_params are model agnostic ).Hence the following snippet would look like this:
The benefit of doing this would be:
The text was updated successfully, but these errors were encountered: