llmir 0.0.11__py3-none-any.whl → 0.0.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
llmir/adapter/openai.py
CHANGED
|
@@ -100,47 +100,27 @@ def to_openai(messages: list[AIMessages]) -> list[OpenAIMessages]:
|
|
|
100
100
|
content_chunks.append(chunk)
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
formatted = OpenAIMessage(
|
|
104
|
-
role=role
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
result.append(
|
|
109
|
-
OpenAIMessage(
|
|
110
|
-
role=role,
|
|
111
|
-
)
|
|
112
|
-
)
|
|
113
|
-
if media_chunks:
|
|
114
|
-
result.append(
|
|
115
|
-
OpenAIMessage(
|
|
116
|
-
role="user", # Hacky, but what else to circumvent API limitations in a broadly compatible way?
|
|
117
|
-
content=[
|
|
118
|
-
content_chunk_to_openai(chunk) for chunk in media_chunks
|
|
119
|
-
],
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
|
|
124
103
|
|
|
125
|
-
formatted = OpenAIMessage(
|
|
126
|
-
role=role
|
|
127
|
-
)
|
|
128
|
-
if content_chunks:
|
|
129
|
-
formatted["content"] = [content_chunk_to_openai(c) for c in content_chunks]
|
|
130
|
-
if tool_call_chunks:
|
|
131
|
-
formatted["tool_calls"] = [tool_call_chunk_to_openai(c) for c in tool_call_chunks]
|
|
132
|
-
|
|
133
|
-
result.append(formatted)
|
|
134
|
-
|
|
135
104
|
if media_chunks:
|
|
136
105
|
result.append(OpenAIMessage(
|
|
137
|
-
role="user",
|
|
106
|
+
role="user", # Hacky too, but what else to circumvent API limitations in a broadly compatible way?
|
|
138
107
|
content=[
|
|
139
108
|
content_chunk_to_openai(c) for c in media_chunks
|
|
140
109
|
]
|
|
141
110
|
)
|
|
142
111
|
)
|
|
143
112
|
|
|
113
|
+
if content_chunks or tool_call_chunks:
|
|
114
|
+
formatted = OpenAIMessage(
|
|
115
|
+
role=role
|
|
116
|
+
)
|
|
117
|
+
if content_chunks:
|
|
118
|
+
formatted["content"] = [content_chunk_to_openai(c) for c in content_chunks]
|
|
119
|
+
if tool_call_chunks:
|
|
120
|
+
formatted["tool_calls"] = [tool_call_chunk_to_openai(c) for c in tool_call_chunks]
|
|
121
|
+
|
|
122
|
+
result.append(formatted)
|
|
123
|
+
|
|
144
124
|
return result
|
|
145
125
|
|
|
146
126
|
|
|
@@ -6,8 +6,8 @@ llmir/rich_repr.py,sha256=ZGAfpcPkYJSUpFdir8B1MoORVFBSzVckCrRHVVkJIj4,559
|
|
|
6
6
|
llmir/roles.py,sha256=B9PmxTHAb8XoiA9en_J1yIP19woddzx4SRUz5XkUxFc,133
|
|
7
7
|
llmir/tools.py,sha256=fpkC3IafHqZJnwo7imtHdkTdGLBHQuR6DtdztXZrlWg,147
|
|
8
8
|
llmir/adapter/__init__.py,sha256=6yYVuYUXWiPPx5-v9PdSojEEw0TSFKz_4ELK9ntpRCw,437
|
|
9
|
-
llmir/adapter/openai.py,sha256=
|
|
10
|
-
llmir-0.0.
|
|
11
|
-
llmir-0.0.
|
|
12
|
-
llmir-0.0.
|
|
13
|
-
llmir-0.0.
|
|
9
|
+
llmir/adapter/openai.py,sha256=vsFPMBAWRxsW9vsZ89CurPi_r1oHeNSwjs0yxWmy-uA,5459
|
|
10
|
+
llmir-0.0.13.dist-info/METADATA,sha256=CtHVXQGX32JCmNnwS7QRN0yYOjGXS9UdwIW84Fs6mKY,178
|
|
11
|
+
llmir-0.0.13.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
llmir-0.0.13.dist-info/top_level.txt,sha256=fm538OsNUSYa_71IPztSSN2PBCvcbaD5PmUIzaO5hQs,6
|
|
13
|
+
llmir-0.0.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|