Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added backwards compat support and resolved issue with 3.11 #340

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/rerun_edited_message_logs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import pathlib
from typing import Union

import typer

Expand All @@ -12,7 +13,7 @@
@app.command()
def main(
messages_path: str,
out_path: str | None = None,
out_path: Union[str, None] = None,
Copy link
Author

Choose a reason for hiding this comment

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

I suppose I would point out, isnt this a bit redundant? Optional[str] by its self works fine but if you need the field set then theres two best practices here:

  1. Optional[str] = None # gives us a default value of None for the field, is polymorphic.
  2. Optional[str] = Field(...) # gives us a default of None with an enforced str type validation - all classes should be dataclasses anyway right?

model: str = "gpt-4",
temperature: float = 0.1,
):
Expand Down