airtrain 0.1.27__tar.gz → 0.1.30__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.
- {airtrain-0.1.27/airtrain.egg-info → airtrain-0.1.30}/PKG-INFO +10 -1
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/__init__.py +1 -1
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/structured_requests_skills.py +30 -5
- {airtrain-0.1.27 → airtrain-0.1.30/airtrain.egg-info}/PKG-INFO +10 -1
- {airtrain-0.1.27 → airtrain-0.1.30}/changelog.md +9 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_requests_example.py +24 -14
- {airtrain-0.1.27 → airtrain-0.1.30}/.flake8 +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.github/workflows/publish.yml +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.gitignore +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.mypy.ini +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.pre-commit-config.yaml +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.vscode/extensions.json +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.vscode/launch.json +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/.vscode/settings.json +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/EXPERIMENTS/integrations_examples/anthropic_with_image.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/EXPERIMENTS/schema_exps/pydantic_schemas.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/MANIFEST.in +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/README.md +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/agents/travel/agents.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/agents/travel/models.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/changelog.md +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/contrib/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/contrib/travel/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/contrib/travel/agentlib/verification_agent.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/contrib/travel/agents.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/contrib/travel/modellib/verification.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/contrib/travel/models.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/__pycache__/credentials.cpython-310.pyc +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/__pycache__/schemas.cpython-310.pyc +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/__pycache__/skills.cpython-310.pyc +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/schemas.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/core/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/anthropic/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/anthropic/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/anthropic/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/aws/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/aws/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/aws/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/cerebras/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/cerebras/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/cerebras/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/combined/groq_fireworks_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/completion_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/conversation_manager.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/models.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/requests_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/structured_completion_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/structured_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/gemini/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/gemini/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/gemini/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/groq/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/groq/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/groq/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/ollama/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/ollama/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/ollama/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/openai/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/openai/chinese_assistant.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/openai/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/openai/models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/openai/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/sambanova/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/sambanova/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/sambanova/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/__init__.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/audio_models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/credentials.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/embedding_models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/image_models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/image_skill.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/models.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/rerank_models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/rerank_skill.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/schemas.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/vision_models_config.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain.egg-info/SOURCES.txt +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain.egg-info/dependency_links.txt +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain.egg-info/requires.txt +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/airtrain.egg-info/top_level.txt +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/anthropic_skills_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/chinese_anthropic_assistant.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/chinese_anthropic_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/chinese_assistant_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/fireworks_skills_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/icon128.png +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/icon16.png +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/image1.jpg +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/image2.jpg +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/openai_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/openai_skills_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/openai_structured_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/together_rerank_skills.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/together_rerank_skills_async.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/credentials_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/images/quantum-circuit.png +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/anthropic/chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/anthropic/chinese_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/anthropic/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/anthropic/vision_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/cerebras/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/combined/groq_fireworks_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/completion_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/parser_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/requests_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/streaming_chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_completion_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_conversation_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/google/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/google/gemini/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/groq/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/openai/chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/openai/parser_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/openai/streaming_chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/openai/vision_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/sambanova/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/together/chat_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/together/conversation_history_test.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/together/image_generation_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/together/rerank_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/schema_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/skill_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/together/image_generation.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/together/image_generation_example.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/examples/travel/verification_agent_usage.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/pyproject.toml +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/requirements.txt +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/scripts/build.sh +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/scripts/bump_version.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/scripts/publish.sh +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/scripts/release.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/services/firebase_service.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/services/openai_service.py +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/setup.cfg +0 -0
- {airtrain-0.1.27 → airtrain-0.1.30}/setup.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: airtrain
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.30
|
4
4
|
Summary: A platform for building and deploying AI agents with structured skills
|
5
5
|
Home-page: https://github.com/rosaboyle/airtrain.dev
|
6
6
|
Author: Dheeraj Pai
|
@@ -171,6 +171,15 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
171
171
|
## Changelog
|
172
172
|
|
173
173
|
|
174
|
+
## 0.1.29
|
175
|
+
|
176
|
+
- Fixed some issues with th strctured output response example.
|
177
|
+
|
178
|
+
## 0.1.28
|
179
|
+
|
180
|
+
- Bug fix: reasoning to Fireworks structured output.
|
181
|
+
- Added reasoning to Fireworks structured output.
|
182
|
+
|
174
183
|
## 0.1.27
|
175
184
|
|
176
185
|
- Added structured completion skills for Fireworks AI
|
{airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/structured_requests_skills.py
RENAMED
@@ -3,6 +3,7 @@ from pydantic import BaseModel, Field
|
|
3
3
|
import requests
|
4
4
|
import json
|
5
5
|
from loguru import logger
|
6
|
+
import re
|
6
7
|
|
7
8
|
from airtrain.core.skills import Skill, ProcessingError
|
8
9
|
from airtrain.core.schemas import InputSchema, OutputSchema
|
@@ -47,6 +48,7 @@ class FireworksStructuredRequestOutput(OutputSchema):
|
|
47
48
|
parsed_response: Any
|
48
49
|
used_model: str
|
49
50
|
usage: Dict[str, int]
|
51
|
+
reasoning: Optional[str] = None
|
50
52
|
|
51
53
|
|
52
54
|
class FireworksStructuredRequestSkill(
|
@@ -128,19 +130,33 @@ class FireworksStructuredRequestSkill(
|
|
128
130
|
except json.JSONDecodeError:
|
129
131
|
continue
|
130
132
|
|
131
|
-
# Once complete, parse the full
|
132
|
-
|
133
|
+
# Once complete, parse the full response with think tags
|
134
|
+
complete_response = "".join(json_buffer)
|
135
|
+
reasoning, json_str = self._parse_response_content(complete_response)
|
136
|
+
|
133
137
|
try:
|
134
138
|
parsed_response = input_data.response_model.model_validate_json(
|
135
|
-
|
139
|
+
json_str
|
136
140
|
)
|
137
|
-
yield {"complete": parsed_response}
|
141
|
+
yield {"complete": parsed_response, "reasoning": reasoning}
|
138
142
|
except Exception as e:
|
139
143
|
raise ProcessingError(f"Failed to parse JSON response: {str(e)}")
|
140
144
|
|
141
145
|
except Exception as e:
|
142
146
|
raise ProcessingError(f"Fireworks streaming request failed: {str(e)}")
|
143
147
|
|
148
|
+
def _parse_response_content(self, content: str) -> tuple[Optional[str], str]:
|
149
|
+
"""Parse response content to extract reasoning and JSON."""
|
150
|
+
# Extract reasoning if present
|
151
|
+
reasoning_match = re.search(r"<think>(.*?)</think>", content, re.DOTALL)
|
152
|
+
reasoning = reasoning_match.group(1).strip() if reasoning_match else None
|
153
|
+
|
154
|
+
# Extract JSON
|
155
|
+
json_match = re.search(r"</think>\s*(\{.*\})", content, re.DOTALL)
|
156
|
+
json_str = json_match.group(1).strip() if json_match else content
|
157
|
+
|
158
|
+
return reasoning, json_str
|
159
|
+
|
144
160
|
def process(
|
145
161
|
self, input_data: FireworksStructuredRequestInput
|
146
162
|
) -> FireworksStructuredRequestOutput:
|
@@ -150,12 +166,14 @@ class FireworksStructuredRequestSkill(
|
|
150
166
|
# For streaming, collect and parse the entire response
|
151
167
|
json_buffer = []
|
152
168
|
parsed_response = None
|
169
|
+
reasoning = None
|
153
170
|
|
154
171
|
for chunk in self.process_stream(input_data):
|
155
172
|
if "chunk" in chunk:
|
156
173
|
json_buffer.append(chunk["chunk"])
|
157
174
|
elif "complete" in chunk:
|
158
175
|
parsed_response = chunk["complete"]
|
176
|
+
reasoning = chunk.get("reasoning")
|
159
177
|
|
160
178
|
if parsed_response is None:
|
161
179
|
raise ProcessingError("Failed to parse streamed response")
|
@@ -164,6 +182,7 @@ class FireworksStructuredRequestSkill(
|
|
164
182
|
parsed_response=parsed_response,
|
165
183
|
used_model=input_data.model,
|
166
184
|
usage={}, # Usage stats not available in streaming mode
|
185
|
+
reasoning=reasoning,
|
167
186
|
)
|
168
187
|
else:
|
169
188
|
# For non-streaming, use regular request
|
@@ -175,14 +194,20 @@ class FireworksStructuredRequestSkill(
|
|
175
194
|
data = response.json()
|
176
195
|
|
177
196
|
response_content = data["choices"][0]["message"]["content"]
|
197
|
+
|
198
|
+
# Parse the response content to extract reasoning and JSON
|
199
|
+
reasoning, json_str = self._parse_response_content(response_content)
|
200
|
+
|
201
|
+
# Parse the JSON string into the specified model
|
178
202
|
parsed_response = input_data.response_model.model_validate_json(
|
179
|
-
|
203
|
+
json_str
|
180
204
|
)
|
181
205
|
|
182
206
|
return FireworksStructuredRequestOutput(
|
183
207
|
parsed_response=parsed_response,
|
184
208
|
used_model=input_data.model,
|
185
209
|
usage=data["usage"],
|
210
|
+
reasoning=reasoning, # Add reasoning to output if present
|
186
211
|
)
|
187
212
|
|
188
213
|
except Exception as e:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: airtrain
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.30
|
4
4
|
Summary: A platform for building and deploying AI agents with structured skills
|
5
5
|
Home-page: https://github.com/rosaboyle/airtrain.dev
|
6
6
|
Author: Dheeraj Pai
|
@@ -171,6 +171,15 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
171
171
|
## Changelog
|
172
172
|
|
173
173
|
|
174
|
+
## 0.1.29
|
175
|
+
|
176
|
+
- Fixed some issues with th strctured output response example.
|
177
|
+
|
178
|
+
## 0.1.28
|
179
|
+
|
180
|
+
- Bug fix: reasoning to Fireworks structured output.
|
181
|
+
- Added reasoning to Fireworks structured output.
|
182
|
+
|
174
183
|
## 0.1.27
|
175
184
|
|
176
185
|
- Added structured completion skills for Fireworks AI
|
@@ -4,6 +4,15 @@ sidebar_position: 9
|
|
4
4
|
|
5
5
|
# Changelog
|
6
6
|
|
7
|
+
## 0.1.29
|
8
|
+
|
9
|
+
- Fixed some issues with th strctured output response example.
|
10
|
+
|
11
|
+
## 0.1.28
|
12
|
+
|
13
|
+
- Bug fix: reasoning to Fireworks structured output.
|
14
|
+
- Added reasoning to Fireworks structured output.
|
15
|
+
|
7
16
|
## 0.1.27
|
8
17
|
|
9
18
|
- Added structured completion skills for Fireworks AI
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_requests_example.py
RENAMED
@@ -2,10 +2,11 @@ import sys
|
|
2
2
|
import os
|
3
3
|
from pathlib import Path
|
4
4
|
from typing import List, Optional
|
5
|
-
from pydantic import BaseModel
|
5
|
+
from pydantic import BaseModel, Field
|
6
6
|
from dotenv import load_dotenv
|
7
7
|
import time
|
8
8
|
import json
|
9
|
+
from time import sleep
|
9
10
|
|
10
11
|
load_dotenv()
|
11
12
|
|
@@ -21,13 +22,14 @@ from airtrain.integrations.fireworks.structured_requests_skills import (
|
|
21
22
|
|
22
23
|
|
23
24
|
class MovieReview(BaseModel):
|
24
|
-
"""
|
25
|
+
"""Schema for movie review"""
|
25
26
|
|
26
|
-
title: str
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
title: str = Field(..., description="Movie title")
|
28
|
+
year: int = Field(..., description="Release year")
|
29
|
+
rating: float = Field(..., description="Rating out of 10")
|
30
|
+
review: str = Field(..., description="Detailed review")
|
31
|
+
pros: list[str] = Field(..., description="List of positive points")
|
32
|
+
cons: list[str] = Field(..., description="List of negative points")
|
31
33
|
|
32
34
|
|
33
35
|
def stream_example():
|
@@ -39,21 +41,25 @@ def stream_example():
|
|
39
41
|
system_prompt="You are a movie critic providing structured reviews.",
|
40
42
|
model="accounts/fireworks/models/deepseek-r1",
|
41
43
|
temperature=0.3,
|
42
|
-
max_tokens=
|
44
|
+
max_tokens=8096,
|
43
45
|
response_model=MovieReview,
|
44
46
|
stream=True,
|
45
47
|
)
|
46
48
|
|
47
49
|
print("\nStreaming structured movie review...")
|
48
50
|
try:
|
49
|
-
json_buffer = []
|
50
51
|
for chunk in skill.process_stream(input_data):
|
51
52
|
if "chunk" in chunk:
|
53
|
+
# Print the raw streaming content
|
52
54
|
print(chunk["chunk"], end="", flush=True)
|
53
|
-
|
55
|
+
sleep(0.01) # Optional: add slight delay for visualization
|
54
56
|
elif "complete" in chunk:
|
57
|
+
# Print the parsed response and reasoning
|
55
58
|
print("\n\nParsed Response:")
|
56
59
|
print(chunk["complete"].model_dump_json(indent=2))
|
60
|
+
if "reasoning" in chunk:
|
61
|
+
print("\nReasoning:")
|
62
|
+
print(chunk["reasoning"])
|
57
63
|
print("\n")
|
58
64
|
except Exception as e:
|
59
65
|
print(f"Error: {str(e)}")
|
@@ -68,7 +74,7 @@ def non_stream_example():
|
|
68
74
|
system_prompt="You are a movie critic providing structured reviews.",
|
69
75
|
model="accounts/fireworks/models/deepseek-r1",
|
70
76
|
temperature=0.3,
|
71
|
-
max_tokens=
|
77
|
+
max_tokens=8096,
|
72
78
|
response_model=MovieReview,
|
73
79
|
stream=False,
|
74
80
|
)
|
@@ -78,6 +84,9 @@ def non_stream_example():
|
|
78
84
|
result = skill.process(input_data)
|
79
85
|
print("\nParsed Response:")
|
80
86
|
print(result.parsed_response.model_dump_json(indent=2))
|
87
|
+
if result.reasoning:
|
88
|
+
print("\nReasoning:")
|
89
|
+
print(result.reasoning)
|
81
90
|
print("\nModel Used:", result.used_model)
|
82
91
|
print("Usage Statistics:", result.usage)
|
83
92
|
except Exception as e:
|
@@ -85,10 +94,11 @@ def non_stream_example():
|
|
85
94
|
|
86
95
|
|
87
96
|
def main():
|
88
|
-
|
89
|
-
|
97
|
+
"""Run the examples"""
|
98
|
+
print("=== Streaming Example ===")
|
99
|
+
# stream_example()
|
90
100
|
|
91
|
-
|
101
|
+
print("\n=== Non-Streaming Example ===")
|
92
102
|
non_stream_example()
|
93
103
|
|
94
104
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/EXPERIMENTS/integrations_examples/anthropic_with_image.py
RENAMED
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
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/fireworks/structured_completion_skills.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/google/gemini/conversation_history_test.py
RENAMED
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
|
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
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/airtrain/integrations/together/embedding_models_config.py
RENAMED
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/creating-skills/together_rerank_skills_async.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/anthropic/conversation_history_test.py
RENAMED
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/cerebras/conversation_history_test.py
RENAMED
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/combined/groq_fireworks_example.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/conversation_history_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/streaming_chat_example.py
RENAMED
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_chat_example.py
RENAMED
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/fireworks/structured_completion_example.py
RENAMED
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/google/conversation_history_test.py
RENAMED
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/google/gemini/conversation_history_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/sambanova/conversation_history_test.py
RENAMED
File without changes
|
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/together/conversation_history_test.py
RENAMED
File without changes
|
{airtrain-0.1.27 → airtrain-0.1.30}/examples/integrations/together/image_generation_example.py
RENAMED
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|