-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Completions.mock_chat_completions to insert logs into Log10
- Loading branch information
1 parent
50759a9
commit 3392ce5
Showing
2 changed files
with
135 additions
and
0 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,21 @@ | ||
|
||
from log10.completions import Completions | ||
|
||
|
||
def main(): | ||
completions = Completions() | ||
model = "gpt-4o" | ||
messages = [ | ||
{"role": "system", "content": "You are a helpful assistant."}, | ||
{"role": "user", "content": "What's the capital of France?"}, | ||
] | ||
response_content = "The capital of France is Paris." | ||
result = completions.mock_chat_completions( | ||
model=model, messages=messages, response_content=response_content, tags=["geography", "test"] | ||
) | ||
print(f"Assistant's response: {result.choices[0].message.content}") | ||
print(f"Model used: {result.model}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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