Skip to content

Commit

Permalink
Merge pull request #272 from FullStackWithLawrence/next
Browse files Browse the repository at this point in the history
test: minor tweaks after testing
  • Loading branch information
lpm0073 authored Jan 25, 2024
2 parents 8913020 + 662d13a commit 6e4bf3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def customized_prompt(config: RefersTo, messages: list) -> list:
"""Return a prompt for Lawrence McDaniel"""
custom_prompt = {
"role": "system",
"content": config.system_prompt,
"content": config.system_prompt.system_prompt,
}

for i, message in enumerate(messages):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def handler(event, context):
):
model = "gpt-3.5-turbo-1106"
messages = customized_prompt(config=config, messages=messages)
tools = info_tool_factory(config=config)
custom_tool = info_tool_factory(config=config)[0]
tools.append(custom_tool)
print(f"Using custom configuration: {config.name} and adding custom tool: {custom_tool}")
break

# https://platform.openai.com/docs/guides/gpt/chat-completions-api
Expand All @@ -92,6 +94,10 @@ def handler(event, context):
item_type="ChatCompletion models",
)
validate_completion_request(request_body)
print("Calling OpenAI Chat Completion API...")
print(
f"model: {model}, messages: {messages}, tools: {tools}, temperature: {temperature}, max_tokens: {max_tokens}"
)
openai_results = openai.chat.completions.create(
model=model,
messages=messages,
Expand Down

0 comments on commit 6e4bf3e

Please sign in to comment.