promptlayer 1.0.60 → 1.1.0
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/README.md +9 -0
- package/dist/esm/chunk-SWBNW72U.js +2 -0
- package/dist/esm/chunk-SWBNW72U.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/openai-agents.js +3 -0
- package/dist/esm/openai-agents.js.map +1 -0
- package/dist/index.d.mts +229 -9
- package/dist/index.d.ts +229 -9
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/openai-agents.d.mts +42 -0
- package/dist/openai-agents.d.ts +42 -0
- package/dist/openai-agents.js +3 -0
- package/dist/openai-agents.js.map +1 -0
- package/package.json +24 -3
- package/src/integrations/openai-agents/helpers.test.ts +254 -0
- package/src/integrations/openai-agents/ids.ts +27 -0
- package/src/integrations/openai-agents/index.ts +8 -0
- package/src/integrations/openai-agents/instrumentation.test.ts +46 -0
- package/src/integrations/openai-agents/instrumentation.ts +47 -0
- package/src/integrations/openai-agents/mapping.ts +714 -0
- package/src/integrations/openai-agents/otlp-json.ts +120 -0
- package/src/integrations/openai-agents/processor.test.ts +509 -0
- package/src/integrations/openai-agents/processor.ts +388 -0
- package/src/integrations/openai-agents/time.ts +56 -0
- package/src/integrations/openai-agents/types.ts +49 -0
- package/src/integrations/openai-agents/url.ts +9 -0
- package/src/openai-agents.ts +1 -0
- package/src/types.ts +302 -9
- package/src/utils/blueprint-builder.test.ts +727 -0
- package/src/utils/blueprint-builder.ts +957 -126
- package/src/utils/streaming.test.ts +498 -0
- package/src/utils/streaming.ts +471 -43
- package/src/utils/utils.ts +4 -0
- package/tsup.config.ts +4 -1
- package/vitest.config.ts +3 -0
package/src/utils/utils.ts
CHANGED
|
@@ -839,6 +839,8 @@ const openaiRequest = async (
|
|
|
839
839
|
const requestToMake =
|
|
840
840
|
MAP_TYPE_TO_OPENAI_FUNCTION[promptBlueprint.prompt_template.type];
|
|
841
841
|
return await requestToMake(client, kwargs);
|
|
842
|
+
} else if (api_type === "images") {
|
|
843
|
+
return await client.images.generate(kwargs);
|
|
842
844
|
} else {
|
|
843
845
|
return await client.responses.create(kwargs);
|
|
844
846
|
}
|
|
@@ -863,6 +865,8 @@ const azureOpenAIRequest = async (
|
|
|
863
865
|
if (api_type === "chat-completions") {
|
|
864
866
|
const requestToMake = MAP_TYPE_TO_OPENAI_FUNCTION[promptBlueprint.prompt_template.type];
|
|
865
867
|
return await requestToMake(client, kwargs);
|
|
868
|
+
} else if (api_type === "images") {
|
|
869
|
+
return await client.images.generate(kwargs);
|
|
866
870
|
} else {
|
|
867
871
|
return await client.responses.create(kwargs);
|
|
868
872
|
}
|
package/tsup.config.ts
CHANGED
|
@@ -4,7 +4,10 @@ import { readFileSync } from "fs";
|
|
|
4
4
|
const pkg = JSON.parse(readFileSync("./package.json", "utf-8"));
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
|
-
entry:
|
|
7
|
+
entry: {
|
|
8
|
+
index: "src/index.ts",
|
|
9
|
+
"openai-agents": "src/openai-agents.ts",
|
|
10
|
+
},
|
|
8
11
|
format: ["cjs", "esm"],
|
|
9
12
|
dts: true,
|
|
10
13
|
clean: true,
|