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.
Files changed (37) hide show
  1. package/README.md +9 -0
  2. package/dist/esm/chunk-SWBNW72U.js +2 -0
  3. package/dist/esm/chunk-SWBNW72U.js.map +1 -0
  4. package/dist/esm/index.js +2 -2
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/esm/openai-agents.js +3 -0
  7. package/dist/esm/openai-agents.js.map +1 -0
  8. package/dist/index.d.mts +229 -9
  9. package/dist/index.d.ts +229 -9
  10. package/dist/index.js +2 -2
  11. package/dist/index.js.map +1 -1
  12. package/dist/openai-agents.d.mts +42 -0
  13. package/dist/openai-agents.d.ts +42 -0
  14. package/dist/openai-agents.js +3 -0
  15. package/dist/openai-agents.js.map +1 -0
  16. package/package.json +24 -3
  17. package/src/integrations/openai-agents/helpers.test.ts +254 -0
  18. package/src/integrations/openai-agents/ids.ts +27 -0
  19. package/src/integrations/openai-agents/index.ts +8 -0
  20. package/src/integrations/openai-agents/instrumentation.test.ts +46 -0
  21. package/src/integrations/openai-agents/instrumentation.ts +47 -0
  22. package/src/integrations/openai-agents/mapping.ts +714 -0
  23. package/src/integrations/openai-agents/otlp-json.ts +120 -0
  24. package/src/integrations/openai-agents/processor.test.ts +509 -0
  25. package/src/integrations/openai-agents/processor.ts +388 -0
  26. package/src/integrations/openai-agents/time.ts +56 -0
  27. package/src/integrations/openai-agents/types.ts +49 -0
  28. package/src/integrations/openai-agents/url.ts +9 -0
  29. package/src/openai-agents.ts +1 -0
  30. package/src/types.ts +302 -9
  31. package/src/utils/blueprint-builder.test.ts +727 -0
  32. package/src/utils/blueprint-builder.ts +957 -126
  33. package/src/utils/streaming.test.ts +498 -0
  34. package/src/utils/streaming.ts +471 -43
  35. package/src/utils/utils.ts +4 -0
  36. package/tsup.config.ts +4 -1
  37. package/vitest.config.ts +3 -0
@@ -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: ["src/index.ts"],
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,
package/vitest.config.ts CHANGED
@@ -3,4 +3,7 @@ import path from "path";
3
3
 
4
4
  export default defineConfig({
5
5
  resolve: { alias: { "@": path.resolve(__dirname, "src") } },
6
+ define: {
7
+ __SDK_VERSION__: JSON.stringify("test-version"),
8
+ },
6
9
  });