hegelai / prompttools

Open-source tools for prompt testing and experimentation, with support for both LLMs (e.g. OpenAI, LLaMA) and vector databases (e.g. Chroma, Weaviate, LanceDB).
http://prompttools.readthedocs.io
Apache License 2.0
2.65k stars 230 forks source link

AttributeError: module 'openai' has no attribute 'types' #122

Open PPadgett opened 7 months ago

PPadgett commented 7 months ago

🐛 Describe the bug

PS C:\LocalDevPipeline> git clone https://github.com/hegelai/prompttools.git Cloning into 'prompttools'... remote: Enumerating objects: 5354, done. remote: Counting objects: 100% (2148/2148), done. remote: Compressing objects: 100% (628/628), done. remote: Total 5354 (delta 1663), reused 1756 (delta 1509), pack-reused 3206 Receiving objects: 100% (5354/5354), 32.83 MiB | 6.39 MiB/s, done. Resolving deltas: 100% (3428/3428), done. Updating files: 100% (193/193), done. PS C:\LocalDevPipeline> cd .\prompttools\ PS C:\LocalDevPipeline\prompttools> streamlit.exe run prompttools/playground/playground.py

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501 Network URL: http://10.0.0.6:8501

2024-02-13 13:21:09.120 Uncaught app exception Traceback (most recent call last): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\LocalDevPipeline\prompttools\prompttools\playground\playground.py", line 25, in from prompttools.playground.constants import MODES, MODEL_TYPES, OPENAI_CHAT_MODELS, OPENAI_COMPLETION_MODELS File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools__init.py", line 7, in from .prompttest import prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\prompttest.py", line 13, in from .runner.runner import run_prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\runner\runner.py", line 13, in from prompttools.experiment import Experiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\init.py", line 9, in from .experiments.openai_chat_experiment import OpenAIChatExperiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 24, in class OpenAIChatExperiment(Experiment): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 177, in OpenAIChatExperiment def _extract_responses(output: openai.types.Completion) -> str: AttributeError: module 'openai' has no attribute 'types' 2024-02-13 13:21:15.920 Uncaught app exception Traceback (most recent call last): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\LocalDevPipeline\prompttools\prompttools\playground\playground.py", line 25, in from prompttools.playground.constants import MODES, MODEL_TYPES, OPENAI_CHAT_MODELS, OPENAI_COMPLETION_MODELS File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\init.py", line 7, in from .prompttest import prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\prompttest.py", line 13, in from .runner.runner import run_prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\runner\runner.py", line 13, in from prompttools.experiment import Experiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\init.py", line 9, in from .experiments.openai_chat_experiment import OpenAIChatExperiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 24, in class OpenAIChatExperiment(Experiment): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 177, in OpenAIChatExperiment def _extract_responses(output: openai.types.Completion) -> str: AttributeError: module 'openai' has no attribute 'types' 2024-02-13 13:21:22.891 Uncaught app exception Traceback (most recent call last): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\LocalDevPipeline\prompttools\prompttools\playground\playground.py", line 25, in from prompttools.playground.constants import MODES, MODEL_TYPES, OPENAI_CHAT_MODELS, OPENAI_COMPLETION_MODELS File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\init.py", line 7, in from .prompttest import prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\prompttest.py", line 13, in from .runner.runner import run_prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\runner\runner.py", line 13, in from prompttools.experiment import Experiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\init.py", line 9, in from .experiments.openai_chat_experiment import OpenAIChatExperiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 24, in class OpenAIChatExperiment(Experiment): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 177, in OpenAIChatExperiment def _extract_responses(output: openai.types.Completion) -> str: AttributeError: module 'openai' has no attribute 'types' 2024-02-13 13:21:23.898 Uncaught app exception Traceback (most recent call last): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\LocalDevPipeline\prompttools\prompttools\playground\playground.py", line 25, in from prompttools.playground.constants import MODES, MODEL_TYPES, OPENAI_CHAT_MODELS, OPENAI_COMPLETION_MODELS File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\init.py", line 7, in from .prompttest import prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\prompttest.py", line 13, in from .runner.runner import run_prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\runner\runner.py", line 13, in from prompttools.experiment import Experiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\init.py", line 9, in from .experiments.openai_chat_experiment import OpenAIChatExperiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 24, in class OpenAIChatExperiment(Experiment): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 177, in OpenAIChatExperiment def _extract_responses(output: openai.types.Completion) -> str: AttributeError: module 'openai' has no attribute 'types' 2024-02-13 13:21:24.001 Uncaught app exception Traceback (most recent call last): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\LocalDevPipeline\prompttools\prompttools\playground\playground.py", line 25, in from prompttools.playground.constants import MODES, MODEL_TYPES, OPENAI_CHAT_MODELS, OPENAI_COMPLETION_MODELS File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\init.py", line 7, in from .prompttest import prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\prompttest.py", line 13, in from .runner.runner import run_prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\runner\runner.py", line 13, in from prompttools.experiment import Experiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\init.py", line 9, in from .experiments.openai_chat_experiment import OpenAIChatExperiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 24, in class OpenAIChatExperiment(Experiment): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 177, in OpenAIChatExperiment def _extract_responses(output: openai.types.Completion) -> str: AttributeError: module 'openai' has no attribute 'types' 2024-02-13 13:21:25.893 Uncaught app exception Traceback (most recent call last): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "C:\LocalDevPipeline\prompttools\prompttools\playground\playground.py", line 25, in from prompttools.playground.constants import MODES, MODEL_TYPES, OPENAI_CHAT_MODELS, OPENAI_COMPLETION_MODELS File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\init.py", line 7, in from .prompttest import prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\prompttest.py", line 13, in from .runner.runner import run_prompttest File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\prompttest\runner\runner.py", line 13, in from prompttools.experiment import Experiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\init__.py", line 9, in from .experiments.openai_chat_experiment import OpenAIChatExperiment File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 24, in class OpenAIChatExperiment(Experiment): File "C:\Users\AllNi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\prompttools\experiment\experiments\openai_chat_experiment.py", line 177, in OpenAIChatExperiment def _extract_responses(output: openai.types.Completion) -> str: AttributeError: module 'openai' has no attribute 'types'