docs: update code example

This commit is contained in:
Dominik Kundel 2025-08-15 16:27:04 -07:00 committed by GitHub
parent 088321b872
commit e21d67af61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,13 +52,8 @@ encoding = load_harmony_encoding(HarmonyEncodingName.HARMONY_GPT_OSS)
system_message = ( system_message = (
SystemContent.new() SystemContent.new()
.with_model_identity(
"You are ChatGPT, a large language model trained by OpenAI."
)
.with_reasoning_effort(ReasoningEffort.HIGH) .with_reasoning_effort(ReasoningEffort.HIGH)
.with_conversation_start_date("2025-06-28") .with_conversation_start_date("2025-06-28")
.with_knowledge_cutoff("2024-06")
.with_required_channels(["analysis", "commentary", "final"])
) )
developer_message = ( developer_message = (
@ -101,11 +96,11 @@ convo = Conversation.from_messages(
Message.from_role_and_content(Role.ASSISTANT, '{"location": "Tokyo"}') Message.from_role_and_content(Role.ASSISTANT, '{"location": "Tokyo"}')
.with_channel("commentary") .with_channel("commentary")
.with_recipient("functions.get_weather") .with_recipient("functions.get_weather")
.with_content_type("json"), .with_content_type("<|constrain|> json"),
Message.from_author_and_content( Message.from_author_and_content(
Author.new(Role.TOOL, "functions.lookup_weather"), Author.new(Role.TOOL, "functions.lookup_weather"),
'{ "temperature": 20, "sunny": true }', '{ "temperature": 20, "sunny": true }',
), ).with_channel("commentary"),
] ]
) )