@buyong/pi-devin 0.1.1 → 0.1.2
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.
- package/package.json +1 -1
- package/src/pi/messages.ts +2 -1
package/package.json
CHANGED
package/src/pi/messages.ts
CHANGED
|
@@ -44,7 +44,8 @@ export function toDevinTranscript(context: TranscriptContext, model: ModelInfo):
|
|
|
44
44
|
const declarations = getCurrentTools(context.messages);
|
|
45
45
|
if (declarations.length && !model.supportsToolCalls) throw new Error("This model does not support the current Pi tool declarations.");
|
|
46
46
|
const tools = declarations.map((tool) => {
|
|
47
|
-
|
|
47
|
+
// Grammar sampling is optional; like Pi's providers without grammar tools, send the JSON schema instead.
|
|
48
|
+
if (tool.constrainedSampling && tool.constrainedSampling.type === "json_schema" && tool.constrainedSampling.strict === "require") {
|
|
48
49
|
throw new Error(`Devin does not support this tool's forced sampling format: ${tool.name}`);
|
|
49
50
|
}
|
|
50
51
|
return { name: tool.name, description: tool.description, jsonSchemaString: JSON.stringify(tool.parameters) };
|