Fix API version in the resolver (#7756)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Engel Nyst
2025-04-08 11:01:23 +02:00
committed by GitHub
parent 22cf5144cc
commit 9fa211bc27
4 changed files with 58 additions and 6 deletions

View File

@@ -349,6 +349,7 @@ def main() -> None:
model=my_args.llm_model or os.environ['LLM_MODEL'],
api_key=SecretStr(api_key) if api_key else None,
base_url=my_args.llm_base_url or os.environ.get('LLM_BASE_URL', None),
api_version=os.environ.get('LLM_API_VERSION', None),
)
repo_instruction = None

View File

@@ -656,12 +656,21 @@ def main() -> None:
raise ValueError('Token is invalid.')
api_key = my_args.llm_api_key or os.environ['LLM_API_KEY']
model = my_args.llm_model or os.environ['LLM_MODEL']
base_url = my_args.llm_base_url or os.environ.get('LLM_BASE_URL', None)
api_version = os.environ.get('LLM_API_VERSION', None)
# Create LLMConfig instance
llm_config = LLMConfig(
model=my_args.llm_model or os.environ['LLM_MODEL'],
model=model,
api_key=SecretStr(api_key) if api_key else None,
base_url=my_args.llm_base_url or os.environ.get('LLM_BASE_URL', None),
base_url=base_url,
)
# Only set api_version if it was explicitly provided, otherwise let LLMConfig handle it
if api_version is not None:
llm_config.api_version = api_version
repo_instruction = None
if my_args.repo_instruction_file:
with open(my_args.repo_instruction_file, 'r') as f: