llmir 0.0.11__tar.gz → 0.0.12__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llmir
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Core message and tool IR for LLM pipelines
5
5
  Author: Mathis Siebert
6
6
  Requires-Python: >=3.11
@@ -100,41 +100,20 @@ 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,
103
+ if content_chunks or tool_call_chunks:
104
+ formatted = OpenAIMessage(
105
+ role=role
111
106
  )
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
-
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]
107
+ if content_chunks:
108
+ formatted["content"] = [content_chunk_to_openai(c) for c in content_chunks]
109
+ if tool_call_chunks:
110
+ formatted["tool_calls"] = [tool_call_chunk_to_openai(c) for c in tool_call_chunks]
132
111
 
133
- result.append(formatted)
112
+ result.append(formatted)
134
113
 
135
114
  if media_chunks:
136
115
  result.append(OpenAIMessage(
137
- role="user",
116
+ role="user", # Hacky too, but what else to circumvent API limitations in a broadly compatible way?
138
117
  content=[
139
118
  content_chunk_to_openai(c) for c in media_chunks
140
119
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llmir
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Core message and tool IR for LLM pipelines
5
5
  Author: Mathis Siebert
6
6
  Requires-Python: >=3.11
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "llmir"
3
- version = "0.0.11"
3
+ version = "0.0.12"
4
4
  description = "Core message and tool IR for LLM pipelines"
5
5
  authors = [{ name="Mathis Siebert" }]
6
6
  requires-python = ">=3.11"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes