Skip to content

postprocess: Tighten model input handling#1852

Closed
Crocodoctopus wants to merge 1 commit into
masterfrom
bg/fix-postprocess-model-key-selection
Closed

postprocess: Tighten model input handling#1852
Crocodoctopus wants to merge 1 commit into
masterfrom
bg/fix-postprocess-model-key-selection

Conversation

@Crocodoctopus

Copy link
Copy Markdown
Contributor

Adds guards for model selection, as well as cleans up an env read that happened deeper than it needed to; env reading now happens in init and is passed down.

I think it wouldn't be a bad idea to combine GEMINI_API_KEY with OPENAI_API_KEY here too, but it would depend on what else uses this API already.

except KeyboardInterrupt:
logging.warning("Interrupted by user, terminating...")
return 130 # 128 + SIGINT(2)
except ValueError as error:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unrelated to key handling; please remove

return os.getenv("OPENAI_API_KEY")
return None

raise ValueError(f"Unsupported model identifier: {model_id}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this?

@thedataking

thedataking commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I think it wouldn't be a bad idea to combine GEMINI_API_KEY with OPENAI_API_KEY here too, but it would depend on what else uses this API already.

I don't know what that would buy us.

Adds guards for model selection, as well as cleans up an env read that happened deeper than it needed to; env reading now happens in init and is passed down.

What specifically was wrong with the current approach?

@thedataking

Copy link
Copy Markdown
Contributor

I don't think we want this change. Please try #1853 and see if that unblocks GaloisInc/Tractor-Crisp#131.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants