Skip to content

Commit e833d6f

Browse files
committed
Fix Missing imports in openai-harmony.md example code
1 parent 6f97a92 commit e833d6f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

articles/openai-harmony.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,20 @@ Additionally the openai_harmony library also includes a StreamableParser for par
126126
```py
127127
from openai_harmony import (
128128
load_harmony_encoding,
129-
StreamableParser
129+
Role,
130+
StreamableParser,
131+
HarmonyEncodingName
130132
)
131-
133+
132134
encoding = load_harmony_encoding(HarmonyEncodingName.HARMONY_GPT_OSS)
133135
stream = StreamableParser(encoding, role=Role.ASSISTANT)
134-
136+
135137
tokens = [
136138
200005,35644,200008,1844,31064,25,392,4827,382,220,17,659,220,17,16842,12295,81645,
137139
13,51441,6052,13,200007,200006,173781,200005,17196,200008,17,659,220,17,314,220,19,
138140
13,200002
139141
]
140-
142+
141143
for token in tokens:
142144
stream.process(token)
143145
print("--------------------------------")

0 commit comments

Comments
 (0)