Skip to content

Commit

Permalink
refactor - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Sep 9, 2024
1 parent 7c28a00 commit 78a4093
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ to use on [AWS SageMaker](https://aws.amazon.com/sagemaker/) replace `<plugin-na

[![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/)

built by 🪄 [`blue_options-4.49.1-abcli-blue-objects-attempt-2-b-2024-09-07-99677`](https://github.com/kamangir/awesome-bash-cli), based on [`openai_commands-3.162.1`](https://github.com/kamangir/openai-commands).
built by 🪄 [`blue_options-4.49.1-abcli-blue-objects-attempt-2-b-2024-09-07-99677`](https://github.com/kamangir/awesome-bash-cli), based on [`openai_commands-3.163.1`](https://github.com/kamangir/openai-commands).
3 changes: 1 addition & 2 deletions openai_commands/DALLE/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from blueness import module
from blueness.argparse.generic import sys_exit
from blue_options.options import Options
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from articraft import html
from openai_commands import NAME, VERSION
Expand Down
2 changes: 1 addition & 1 deletion openai_commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

VERSION = "3.162.1"
VERSION = "3.163.1"

REPO_NAME = "openai-commands"

Expand Down
3 changes: 1 addition & 2 deletions openai_commands/completion/functions/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import random

from blue_options.host import is_jupyter
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from openai_commands.completion.api import complete_prompt
from openai_commands.logger import logger
Expand Down
3 changes: 1 addition & 2 deletions openai_commands/completion/prompts/bash.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects


class bash_prompt:
Expand Down
3 changes: 1 addition & 2 deletions openai_commands/images/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

from blueness.argparse.generic import sys_exit
from blue_options import string
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from openai_commands import NAME, VERSION
from openai_commands.images.api import OpenAIImageGenerator
Expand Down
2 changes: 1 addition & 1 deletion openai_commands/literature_review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ literature review at scale on [AWS Batch](https://aws.amazon.com/batch/) through
| | |
| --- | --- |
| [aws_batch](https://github.com/kamangir/notebooks-and-scripts/tree/main/notebooks_and_scripts/workflow/runners/aws_batch.py) | [local](https://github.com/kamangir/notebooks-and-scripts/tree/main/notebooks_and_scripts/workflow/runners/local.py) |
| [![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=Mem24SR5ee0G6GMg)](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=Mem24SR5ee0G6GMg) | [![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=D8rBuHWXTtVdUMA9)](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-local-study-type-screening-result/workflow.gif?raw=true&random=D8rBuHWXTtVdUMA9) |
| [![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=CsFYkA3f7O6pUQHw)](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=CsFYkA3f7O6pUQHw) | [![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=CW9KQdO9zbcMlNDF)](https://kamangir-public.s3.ca-central-1.amazonaws.com/AMR-v7-test-litrev-multiple-local-study-type-screening-result/workflow.gif?raw=true&random=CW9KQdO9zbcMlNDF) |

---

Expand Down
3 changes: 1 addition & 2 deletions openai_commands/literature_review/combination.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import pandas as pd

from blueness import module
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from openai_commands import NAME
from openai_commands.logger import logger
Expand Down
3 changes: 1 addition & 2 deletions openai_commands/literature_review/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from tqdm import tqdm

from blueness import module
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from openai_commands import NAME
from openai_commands.completion.api import complete_prompt
Expand Down
11 changes: 7 additions & 4 deletions openai_commands/tests/test_ai_function_bash.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import pytest
from abcli.modules.objects import select
from abcli.plugins.testing import download_object

from blue_objects import objects

from openai_commands import env
from openai_commands.completion.functions.bash import ai_function_bash
from openai_commands.completion.prompts.bash import bash_prompt


@pytest.skip(reason="select() is obsolete.")
@pytest.mark.parametrize(
[
"object_name",
Expand All @@ -15,9 +17,10 @@
],
)
def test_ai_function_bash(object_name):
assert download_object(object_name)
assert objects.download(object_name)

select(object_name)
# select(object_name)
assert False

prompt = bash_prompt("ingest vancouver.")

Expand Down
4 changes: 3 additions & 1 deletion openai_commands/tests/test_bash_prompt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest

from blue_objects import objects

from openai_commands.completion.prompts.bash import bash_prompt
from abcli.modules import objects


@pytest.mark.parametrize(
Expand Down
3 changes: 1 addition & 2 deletions openai_commands/tests/test_gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import pytest
from typing import List

from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from openai_commands.gpt.chat import chat_with_openai, interact_with_openai, list_models

Expand Down
2 changes: 1 addition & 1 deletion openai_commands/tests/test_images.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from blue_options import string
from abcli.modules import objects
from blue_objects import objects

from openai_commands.images.api import OpenAIImageGenerator

Expand Down
8 changes: 3 additions & 5 deletions openai_commands/tests/test_literature_review.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest

from blue_objects import file
from abcli.modules import objects
from abcli.plugins.testing import download_object
from blue_objects import file, objects

from openai_commands import env
from openai_commands.literature_review.functions import (
Expand All @@ -27,7 +25,7 @@ def test_generate_prompt(
object_name: str,
question: str,
):
assert download_object(object_name)
assert objects.download(object_name)

success, question_dict = file.load_yaml(
objects.path_of(
Expand Down Expand Up @@ -70,7 +68,7 @@ def test_literature_review(
):
output_object_name = objects.unique_object("test")

assert download_object(input_object_name)
assert objects.download(input_object_name)

assert review_literature(
input_object_name=input_object_name,
Expand Down
6 changes: 4 additions & 2 deletions openai_commands/tests/test_vision.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest

from blue_options.options import Options
from abcli.plugins.testing import download_object
from blue_objects import objects

from openai_commands import env
from openai_commands.vision.completion import complete_object

Expand All @@ -15,7 +17,7 @@
],
)
def test_vision_complete(object_name):
assert download_object(object_name)
assert objects.download(object_name)

assert isinstance(
complete_object(
Expand Down
3 changes: 1 addition & 2 deletions openai_commands/vision/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from blue_objects.env import ABCLI_PUBLIC_PREFIX
from blue_options.options import Options
from blue_options import string
from blue_objects import file
from abcli.modules import objects
from blue_objects import file, objects

from openai_commands import env, NAME
from openai_commands.logger import logger
Expand Down

0 comments on commit 78a4093

Please sign in to comment.