mirror of
https://github.com/codelion/optillm.git
synced 2025-05-28 09:39:38 +03:00
override approach if set in messages
This commit is contained in:
@@ -288,11 +288,10 @@ def proxy():
|
||||
|
||||
system_prompt, initial_query, message_optillm_approach = parse_conversation(messages)
|
||||
|
||||
# Use optillm_approach from extra_body if present, otherwise use from messages
|
||||
if not optillm_approach and message_optillm_approach:
|
||||
if message_optillm_approach:
|
||||
optillm_approach = message_optillm_approach
|
||||
|
||||
if optillm_approach:
|
||||
if optillm_approach != "auto":
|
||||
model = f"{optillm_approach}-{model}"
|
||||
|
||||
base_url = server_config['base_url']
|
||||
|
||||
@@ -18,6 +18,7 @@ def best_of_n_sampling(system_prompt: str, initial_query: str, client, model: st
|
||||
temperature=1
|
||||
)
|
||||
completions = [choice.message.content for choice in response.choices]
|
||||
logger.info(f"Generated {len(completions)} initial completions. Tokens used: {response.usage.completion_tokens}")
|
||||
bon_completion_tokens += response.usage.completion_tokens
|
||||
|
||||
# Rate the completions
|
||||
|
||||
Reference in New Issue
Block a user