-
Notifications
You must be signed in to change notification settings - Fork 1
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
allow running flow from json #32
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 73.49% 71.54% -1.96%
==========================================
Files 16 17 +1
Lines 449 485 +36
==========================================
+ Hits 330 347 +17
- Misses 119 138 +19
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
omnibridge/flows/graph_flow.py
Outdated
if 'models' in json_data: | ||
next_models_data = json_data['models'] | ||
for next_model_data in next_models_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion, IMO it is clearer that way
if 'models' in json_data: | |
next_models_data = json_data['models'] | |
for next_model_data in next_models_data: | |
for next_model_data in json_data.get('models', []) |
omnibridge/flows/graph_flow.py
Outdated
instruction = "" | ||
if 'instruction' in json_data: | ||
instruction = json_data['instruction'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion, IMO it is clearer that way
instruction = "" | |
if 'instruction' in json_data: | |
instruction = json_data['instruction'] | |
instruction = json_data.get('instruction', '') |
omnibridge/flows/graph_flow.py
Outdated
|
||
def process(self, model_input: ModelIO) -> ModelIO: | ||
assert isinstance(model_input, TextualIO) | ||
model_input = TextualIO(model_input.get_text() + "\n" + self.instruction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion, f-strings are the standard in Python + slight performance advantage over concatenation.
model_input = TextualIO(model_input.get_text() + "\n" + self.instruction) | |
model_input = TextualIO(f'{model_input.get_text()}\n{self.instruction}') |
retries = 2 | ||
retry_delay = 30 # seconds | ||
for attempt in range(retries): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following the talk we had this morning, do we still need a retry mechanism?
If so, I think moving the functionality into a decorator is favorable, wdyt?
for example: https://stackoverflow.com/questions/50246304/using-python-decorators-to-retry-request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
allow running flow from json
No description provided.