mirror of
https://github.com/kennethreitz/instructor.git
synced 2026-06-05 22:50:18 +00:00
move tests
This commit is contained in:
@@ -38,7 +38,7 @@ jobs:
|
||||
run: poetry install --with dev
|
||||
|
||||
- name: Run tests
|
||||
run: poetry run pytest tests/ -k "not evals"
|
||||
run: poetry run pytest tests/ -k "not openai"
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
|
||||
@@ -22,15 +22,6 @@ def client():
|
||||
base_url="https://braintrustproxy.com/v1",
|
||||
)
|
||||
)
|
||||
elif (
|
||||
os.environ.get("OPENAI_BASE_URL", None)
|
||||
== "https://api.endpoints.anyscale.com/v1"
|
||||
):
|
||||
yield OpenAI(
|
||||
api_key=os.environ["OPENAI_API_KEY"],
|
||||
base_url="https://api.endpoints.anyscale.com/v1",
|
||||
)
|
||||
|
||||
else:
|
||||
yield OpenAI()
|
||||
|
||||
@@ -44,13 +35,5 @@ def aclient():
|
||||
base_url="https://braintrustproxy.com/v1",
|
||||
)
|
||||
)
|
||||
elif (
|
||||
os.environ.get("OPENAI_BASE_URL", None)
|
||||
== "https://api.endpoints.anyscale.com/v1"
|
||||
):
|
||||
yield AsyncOpenAI(
|
||||
api_key=os.environ["OPENAI_API_KEY"],
|
||||
base_url="https://api.endpoints.anyscale.com/v1",
|
||||
)
|
||||
else:
|
||||
yield AsyncOpenAI()
|
||||
|
||||
+7
-15
@@ -1,18 +1,10 @@
|
||||
import os
|
||||
import instructor
|
||||
|
||||
if os.getenv("OPENAI_BASE_URL", None) == "https://api.endpoints.anyscale.com/v1":
|
||||
models = ["mistralai/Mistral-7B-Instruct-v0.1"]
|
||||
modes = [instructor.Mode.JSON_SCHEMA]
|
||||
else:
|
||||
models = ["gpt-3.5-turbo-1106", "gpt-4", "gpt-4-1106-preview"]
|
||||
modes = [
|
||||
instructor.Mode.FUNCTIONS,
|
||||
instructor.Mode.JSON,
|
||||
instructor.Mode.TOOLS,
|
||||
instructor.Mode.MD_JSON,
|
||||
]
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(models)
|
||||
print(modes)
|
||||
models = ["gpt-3.5-turbo-1106", "gpt-4", "gpt-4-1106-preview"]
|
||||
modes = [
|
||||
instructor.Mode.FUNCTIONS,
|
||||
instructor.Mode.JSON,
|
||||
instructor.Mode.TOOLS,
|
||||
instructor.Mode.MD_JSON,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user