Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
steventkrawczyk committed Dec 23, 2023
2 parents d0e982e + c8720cd commit 3e52fab
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions test/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
# LICENSE file in the root directory of this source tree.


import openai
import prompttools.logger # noqa: F401 Importing this line will monkey-patch `openai.chat.completions.create`
if False: # Skipping this in CI

import openai
import prompttools.logger # noqa: F401 Importing this line will monkey-patch `openai.chat.completions.create`


r"""
Expand All @@ -23,17 +25,18 @@
"""

if __name__ == "__main__":
for i in range(1):
messages = [
{"role": "user", "content": f"What is 1 + {i}?"},
]

# `hegel_model` is an optional argument that allows you to tag your call with a specific name
# Logging still works without this argument
# The rest of the OpenAI call happens as normal between your machine and OpenAI's server
openai_response = openai.chat.completions.create(
model="gpt-3.5-turbo", messages=messages, hegel_model="Math Model"
)
print(f"{openai_response = }")

print("End")
if False: # Skipping this in CI
for i in range(1):
messages = [
{"role": "user", "content": f"What is 1 + {i}?"},
]

# `hegel_model` is an optional argument that allows you to tag your call with a specific name
# Logging still works without this argument
# The rest of the OpenAI call happens as normal between your machine and OpenAI's server
openai_response = openai.chat.completions.create(
model="gpt-3.5-turbo", messages=messages, hegel_model="Math Model"
)
print(f"{openai_response = }")

print("End")

0 comments on commit 3e52fab

Please sign in to comment.