Skip to content

Commit

Permalink
add load.log10 and langchain tests (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhe-log10 authored Nov 16, 2023
1 parent e96c622 commit 7601303
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions log10/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,23 @@ def log10(module, DEBUG_=False, USE_ASYNC_=True):
>>> )
>>> print(response)
Example:
>>> from log10.load import log10
>>> from langchain.chat_models import ChatOpenAI
>>> from langchain.schema import HumanMessage, SystemMessage
>>> import openai
>>> log10(openai)
>>> llm = ChatOpenAI(
>>> model_name="gpt-3.5-turbo",
>>> temperature=0.5,
>>> )
>>> messages = [
>>> SystemMessage(content="You are a ping pong machine"),
>>> HumanMessage(content="Ping?")
>>> ]
>>> completion = llm.predict_messages(messages)
>>> print(completion)
Example:
>>> from log10.load import log10
>>> import anthropic
Expand All @@ -373,6 +390,20 @@ def log10(module, DEBUG_=False, USE_ASYNC_=True):
>>> prompt=f"{HUMAN_PROMPT} Hi, how are you? {AI_PROMPT}",
>>> )
>>> print(completion.completion)
Example:
>>> from log10.load import log10
>>> import anthropic
>>> from langchain.chat_models import ChatAnthropic
>>> from langchain.schema import HumanMessage, SystemMessage
>>> log10(anthropic)
>>> llm = ChatAnthropic(model="claude-1", temperature=0.7)
>>> messages = [
>>> SystemMessage(content="You are a ping pong machine"),
>>> HumanMessage(content="Ping?")
>>> ]
>>> completion = llm.predict_messages(messages)
>>> print(completion)
"""
global DEBUG, USE_ASYNC, sync_log_text
DEBUG = DEBUG_
Expand Down

0 comments on commit 7601303

Please sign in to comment.