🐛 fix /edit max_tokens too large for gpt-4-turbo

This commit is contained in:
Nate Sesti 2023-11-22 17:31:17 -07:00
parent 66e33983e6
commit 07cc2fdf2e

View file

@ -625,7 +625,7 @@ Please output the code to be inserted at the cursor in order to fulfill the user
async for chunk in model_to_use.stream_chat(
messages,
temperature=sdk.config.completion_options.temperature,
max_tokens=min(max_tokens, model_to_use.context_length // 2),
max_tokens=min(max_tokens, model_to_use.context_length // 2, 4096),
):
yield chunk.content