-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from log10-io/nqn/session-bug
Session bug (fix with context variables)
- Loading branch information
Showing
4 changed files
with
254 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from log10.load import OpenAI, log10_session | ||
|
||
|
||
client = OpenAI() | ||
response = client.completions.create( | ||
model="gpt-3.5-turbo-instruct", | ||
prompt="I am demonstrating nested tags. Write a test case for this. This is the outer most call without any tags.", | ||
temperature=0, | ||
max_tokens=1024, | ||
top_p=1, | ||
frequency_penalty=0, | ||
presence_penalty=0, | ||
) | ||
print(response) | ||
|
||
with log10_session(tags=["outer_tag"]): | ||
response = client.completions.create( | ||
model="gpt-3.5-turbo-instruct", | ||
prompt="I am demonstrating nested tags. Write a test case for this. This is a inner call with tags.", | ||
temperature=0, | ||
max_tokens=1024, | ||
top_p=1, | ||
frequency_penalty=0, | ||
presence_penalty=0, | ||
) | ||
print(response) | ||
|
||
with log10_session(tags=["inner_tag"]): | ||
response = client.completions.create( | ||
model="gpt-3.5-turbo-instruct", | ||
prompt="I am demonstrating nested tags. Write a test case for this. This is the inner most call with tags.", | ||
temperature=0, | ||
max_tokens=1024, | ||
top_p=1, | ||
frequency_penalty=0, | ||
presence_penalty=0, | ||
) | ||
print(response) | ||
|
||
response = client.completions.create( | ||
model="gpt-3.5-turbo-instruct", | ||
prompt="I am demonstrating nested tags. Write a test case for this. This is a inner call which should have outer tag.", | ||
temperature=0, | ||
max_tokens=1024, | ||
top_p=1, | ||
frequency_penalty=0, | ||
presence_penalty=0, | ||
) | ||
print(response) | ||
|
||
response = client.completions.create( | ||
model="gpt-3.5-turbo-instruct", | ||
prompt="I am demonstrating nested tags. Write a test case for this. This is the outer most call without any tags (final call)", | ||
temperature=0, | ||
max_tokens=1024, | ||
top_p=1, | ||
frequency_penalty=0, | ||
presence_penalty=0, | ||
) | ||
print(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.