Skip to content

Commit 8f31f90

Browse files
authored
Merge pull request #22 from kamangir/text-generation-refactors-2025-02-03-bhoji4
text generation refactors
2 parents f966741 + 43204f5 commit 8f31f90

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ graph LR
6161

6262
[![pylint](https://github.com/kamangir/openai-commands/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/openai-commands/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/openai-commands/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/openai-commands/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/openai-commands/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/openai-commands/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/openai-commands.svg)](https://pypi.org/project/openai-commands/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/openai-commands)](https://pypistats.org/packages/openai-commands)
6363

64-
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on [`openai_commands-3.239.1`](https://github.com/kamangir/openai-commands).
64+
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on [`openai_commands-3.240.1`](https://github.com/kamangir/openai-commands).

openai_commands/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
DESCRIPTION = f"{ICON} a command interface to the OpenAI API."
66

7-
VERSION = "3.239.1"
7+
VERSION = "3.240.1"
88

99
REPO_NAME = "openai-commands"
1010

openai_commands/image_generation/api.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import json
22
from openai import OpenAI
3-
from typing import Tuple, Any
3+
from typing import Tuple, Any, List
44
from IPython.display import Image, display
55

66
from blueness import module
77
from blue_options import string
88
from blue_options.host import is_jupyter
9-
from blue_objects import file, graphics, objects, path
9+
from blue_objects import file, objects, path
1010
from blue_objects.graphics.signature import sign_filename
1111

12-
from openai_commands import NAME, VERSION
12+
from openai_commands import NAME
1313
from openai_commands.host import signature
1414
from openai_commands import env
1515
from openai_commands.logger import logger
@@ -44,6 +44,8 @@ def generate(
4444
line_width: int = 80,
4545
quality: str = "standard",
4646
size: str = "1024x1024",
47+
sign_with_prompt: bool = True,
48+
footer: List[str] = [],
4749
) -> Tuple[bool, Any]:
4850
object_name = path.name(file.path(filename))
4951

@@ -88,9 +90,14 @@ def generate(
8890
],
8991
footer=[
9092
" | ".join(
91-
[
92-
f"prompt: {prompt}",
93-
f"revised prompt: {str(response.data[0].revised_prompt)}",
93+
footer
94+
+ ([f"prompt: {prompt}"] if sign_with_prompt else [])
95+
+ (
96+
[f"revised prompt: {str(response.data[0].revised_prompt)}"]
97+
if self.verbose
98+
else []
99+
)
100+
+ [
94101
f"model: {self.model}",
95102
]
96103
+ signature()

openai_commands/literature_review/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ literature review at scale on [AWS Batch](https://aws.amazon.com/batch/) through
4949
| | |
5050
| --- | --- |
5151
| [aws_batch](https://github.com/kamangir/notebooks-and-scripts/tree/main/blueflow/workflow/runners/aws_batch.py) | [local](https://github.com/kamangir/notebooks-and-scripts/tree/main/blueflow/workflow/runners/local.py) |
52-
| [![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-aws_batch-study-type-screening-result/workflow.gif?raw=true&random=qg9wdwppix64z4kz)](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-aws_batch-study-type-screening-result/workflow.gif?raw=true&random=qg9wdwppix64z4kz) | [![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-local-study-type-screening-result/workflow.gif?raw=true&random=z444ntyvhitjwxro)](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-local-study-type-screening-result/workflow.gif?raw=true&random=z444ntyvhitjwxro) |
52+
| [![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-aws_batch-study-type-screening-result/workflow.gif?raw=true&random=7cyivmaoimp74gpx)](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-aws_batch-study-type-screening-result/workflow.gif?raw=true&random=7cyivmaoimp74gpx) | [![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-local-study-type-screening-result/workflow.gif?raw=true&random=evxnkv0vx2ngvfiv)](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-local-study-type-screening-result/workflow.gif?raw=true&random=evxnkv0vx2ngvfiv) |
5353

5454
---
5555

0 commit comments

Comments
 (0)