Skip to content

Commit

Permalink
Update - make tiny adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Nov 29, 2023
1 parent 3064679 commit c3960d7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions examples/startup_technical_ideas/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,15 @@
temperature=FloatParam(0.2),
model=MultipleChoiceParam("gpt-3.5-turbo", CHAT_LLM_GPT),
max_tokens=ag.IntParam(-1, -1, 4000),
prompt_system=ag.TextParam(SYSTEM_PROMPT),
)


@ag.entrypoint
def chat(
inputs: MessagesInput = MessagesInput(
[{"role": "system", "content": SYSTEM_PROMPT}]
),
messages: MessagesInput = MessagesInput(),
) -> str:
messages = [
{
"role": message["role"],
"content": message["content"],
}
for message in inputs
]
messages = [{"role": "system", "content": ag.config.system_prompt}] + messages
max_tokens = ag.config.max_tokens if ag.config.max_tokens != -1 else None
chat_completion = client.chat.completions.create(
model=ag.config.model,
Expand Down

0 comments on commit c3960d7

Please sign in to comment.