Skip to content

Commit

Permalink
Rename scribe to logger
Browse files Browse the repository at this point in the history
  • Loading branch information
NivekT committed Dec 18, 2023
1 parent 34f1c2a commit 00d308b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# LICENSE file in the root directory of this source tree.


from .scribe import Scribe
from .logger import Logger


__all__ = [
"Scribe",
"Logger",
]
6 changes: 3 additions & 3 deletions prompttools/scribe/scribe.py → prompttools/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
load_dotenv(dotenv_path)


class Scribe:
class Logger:
def __init__(self):
self.backend_url = f"{HEGEL_BACKEND_URL}/sdk/scribe"
self.backend_url = f"{HEGEL_BACKEND_URL}/sdk/logger"
self.data_queue = queue.Queue()
self.worker_thread = threading.Thread(target=self.worker)

Expand Down Expand Up @@ -71,7 +71,7 @@ def log_data_to_remote(self, data):
print(f"Error sending data to Flask API: {e}")


sender = Scribe()
sender = Logger()
# Monkey-patching
try:
openai.chat.completions.create = sender.wrap(openai.chat.completions.create)
Expand Down
2 changes: 1 addition & 1 deletion test/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


r"""
App for local testing of scribe
App for local testing of logger
"""

from flask import Flask, request
Expand Down
11 changes: 5 additions & 6 deletions test/test_scribe.py → test/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@

# import openai
# import os

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

# if __name__ == "__main__":
#
# os.environ["OPENAI_API_KEY"] = ""
# import prompttools.logger # noqa: F401 Importing this line will monkey-patch `openai.chat.completions.create`
#
#
# if __name__ == "__main__":
#
# # Launch server from `app.py` first
# # Example usage:
# for i in range(3):
# for i in range(1):
# messages = [
# {"role": "user", "content": f"What is 1 + {i}?"},
# ]
Expand Down

0 comments on commit 00d308b

Please sign in to comment.