@promptbook/openai 0.52.0-1 → 0.52.0-3

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 (52) hide show
  1. package/README.md +12 -6
  2. package/esm/index.es.js +16 -17
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/_packages/anthropic-claude.index.d.ts +3 -0
  5. package/esm/typings/_packages/azure-openai.index.d.ts +3 -0
  6. package/esm/typings/_packages/core.index.d.ts +2 -1
  7. package/esm/typings/_packages/openai.index.d.ts +1 -1
  8. package/esm/typings/execution/PromptResult.d.ts +3 -3
  9. package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +42 -0
  10. package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +8 -0
  11. package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/anthropic-claude-models.d.ts +20 -0
  12. package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/playground/playground.d.ts +2 -0
  13. package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +41 -0
  14. package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +34 -0
  15. package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/playground/playground.d.ts +2 -0
  16. package/esm/typings/execution/plugins/llm-execution-tools/langtail/playground/playground.d.ts +2 -0
  17. package/esm/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
  18. package/esm/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts +2 -2
  19. package/esm/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionTools.d.ts +35 -0
  20. package/esm/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionToolsOptions.d.ts +23 -0
  21. package/esm/typings/execution/plugins/llm-execution-tools/multiple/playground/playground.d.ts +2 -0
  22. package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +3 -3
  23. package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +3 -1
  24. package/esm/typings/execution/plugins/llm-execution-tools/openai/computeUsage.d.ts +6 -3
  25. package/esm/typings/execution/plugins/llm-execution-tools/openai/{models.d.ts → openai-models.d.ts} +2 -1
  26. package/esm/typings/execution/plugins/llm-execution-tools/openai/playground/playground.d.ts +2 -0
  27. package/package.json +2 -2
  28. package/umd/index.umd.js +16 -17
  29. package/umd/index.umd.js.map +1 -1
  30. package/umd/typings/_packages/anthropic-claude.index.d.ts +3 -0
  31. package/umd/typings/_packages/azure-openai.index.d.ts +3 -0
  32. package/umd/typings/_packages/core.index.d.ts +2 -1
  33. package/umd/typings/_packages/openai.index.d.ts +1 -1
  34. package/umd/typings/execution/PromptResult.d.ts +3 -3
  35. package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +42 -0
  36. package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +8 -0
  37. package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/anthropic-claude-models.d.ts +20 -0
  38. package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/playground/playground.d.ts +2 -0
  39. package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +41 -0
  40. package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +34 -0
  41. package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/playground/playground.d.ts +2 -0
  42. package/umd/typings/execution/plugins/llm-execution-tools/langtail/playground/playground.d.ts +2 -0
  43. package/umd/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
  44. package/umd/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts +2 -2
  45. package/umd/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionTools.d.ts +35 -0
  46. package/umd/typings/execution/plugins/llm-execution-tools/multiple/MultipleLlmExecutionToolsOptions.d.ts +23 -0
  47. package/umd/typings/execution/plugins/llm-execution-tools/multiple/playground/playground.d.ts +2 -0
  48. package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +3 -3
  49. package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +3 -1
  50. package/umd/typings/execution/plugins/llm-execution-tools/openai/computeUsage.d.ts +6 -3
  51. package/umd/typings/execution/plugins/llm-execution-tools/openai/{models.d.ts → openai-models.d.ts} +2 -1
  52. package/umd/typings/execution/plugins/llm-execution-tools/openai/playground/playground.d.ts +2 -0
@@ -10,7 +10,7 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
10
10
  /**
11
11
  * OpenAI API client.
12
12
  */
13
- private readonly openai;
13
+ private readonly client;
14
14
  /**
15
15
  * Creates OpenAI Execution Tools.
16
16
  *
@@ -20,11 +20,11 @@ export declare class OpenAiExecutionTools implements LlmExecutionTools {
20
20
  /**
21
21
  * Calls OpenAI API to use a chat model.
22
22
  */
23
- gptChat(prompt: Prompt): Promise<PromptChatResult>;
23
+ gptChat(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptChatResult>;
24
24
  /**
25
25
  * Calls OpenAI API to use a complete model.
26
26
  */
27
- gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
27
+ gptComplete(prompt: Pick<Prompt, 'content' | 'modelRequirements'>): Promise<PromptCompletionResult>;
28
28
  /**
29
29
  * Default model for chat variant.
30
30
  */
@@ -10,7 +10,9 @@ import type { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsO
10
10
  export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & ClientOptions & {
11
11
  /**
12
12
  * A unique identifier representing your end-user, which can help OpenAI to monitor
13
- * and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).
13
+ * and detect abuse.
14
+ *
15
+ * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
14
16
  */
15
17
  user?: string_token;
16
18
  };
@@ -1,13 +1,16 @@
1
1
  /**
2
- * String value found on openai page
2
+ * String value found on OpenAI and Anthropic Claude page
3
+ *
4
+ * @see https://openai.com/api/pricing/
5
+ * @see https://docs.anthropic.com/en/docs/models-overview
3
6
  *
4
7
  * @private within the library, used only as internal helper for `OPENAI_MODELS` and `computeUsage`
5
8
  */
6
- type string_openai_price = `$${number}.${number} / ${number}M tokens`;
9
+ type string_model_price = `$${number}.${number} / ${number}M tokens`;
7
10
  /**
8
11
  * Function computeUsage will create price per one token based on the string value found on openai page
9
12
  *
10
13
  * @private within the library, used only as internal helper for `OPENAI_MODELS`
11
14
  */
12
- export declare function computeUsage(value: string_openai_price): number;
15
+ export declare function computeUsage(value: string_model_price): number;
13
16
  export {};
@@ -16,7 +16,8 @@ export declare const OPENAI_MODELS: Array<AvailableModel & {
16
16
  }>;
17
17
  /**
18
18
  * TODO: [🧠] Some mechanism to propagate unsureness
19
- * TODO: [🕚] Make this list dynamic - dynamically can be listed modelNames but not modelVariant, legacy status, context length and pricing
19
+ * TODO: [🕚][👮‍♀️] Make this list dynamic - dynamically can be listed modelNames but not modelVariant, legacy status, context length and pricing
20
+ * TODO: [🧠][👮‍♀️] Put here more info like description, isVision, trainingDateCutoff, languages, strengths ( Top-level performance, intelligence, fluency, and understanding), contextWindow,...
20
21
  * @see https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4
21
22
  * @see https://openai.com/api/pricing/
22
23
  * @see /other/playground/playground.ts
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ts-node
2
+ export {};