Skip to content

Commit

Permalink
Merge pull request #24 from prompt-foundry/release-please--branches--…
Browse files Browse the repository at this point in the history
…main--changes--next--components--typescript-sdk

release: 1.4.0
  • Loading branch information
anthonyjgrove authored Jun 14, 2024
2 parents d8983ac + 3d10b5e commit 6074d4d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 204 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.3.0"
".": "1.4.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-0b67f25d6d4fdd34057ac5f57434d488db64fe65f0b2c4729b97232c64927b13.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-e2cae3fe1d0a839dbd41f4120ff919c13c241c083c00c50f9ce005f8709bd447.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.4.0 (2024-06-14)

Full Changelog: [v1.3.0...v1.4.0](https://github.com/prompt-foundry/typescript-sdk/compare/v1.3.0...v1.4.0)

### Features

* **api:** OpenAPI spec update via Stainless API ([#23](https://github.com/prompt-foundry/typescript-sdk/issues/23)) ([ce520cf](https://github.com/prompt-foundry/typescript-sdk/commit/ce520cf918bac70bf5fcc06689f0b6a871be1488))

## 1.3.0 (2024-06-13)

Full Changelog: [v1.2.0...v1.3.0](https://github.com/prompt-foundry/typescript-sdk/compare/v1.2.0...v1.3.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prompt-foundry/typescript-sdk",
"version": "1.3.0",
"version": "1.4.0",
"description": "The official TypeScript library for the Prompt Foundry API",
"author": "Prompt Foundry <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
213 changes: 13 additions & 200 deletions src/resources/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,19 @@ export class Prompts extends APIResource {
export interface ModelParameters {
name: string;

parameters:
| ModelParameters.OpenAICreateCompletionNonStreamingRequest
| ModelParameters.OpenAICreateCompletionStreamingRequest;
parameters: ModelParameters.Parameters;

provider: 'openai';
}

export namespace ModelParameters {
export interface OpenAICreateCompletionNonStreamingRequest {
export interface Parameters {
messages: Array<
| OpenAICreateCompletionNonStreamingRequest.OpenAIChatCompletionRequestSystemMessage
| OpenAICreateCompletionNonStreamingRequest.OpenAIChatCompletionRequestUserMessage
| OpenAICreateCompletionNonStreamingRequest.OpenAIChatCompletionRequestAssistantMessage
| OpenAICreateCompletionNonStreamingRequest.OpenAIChatCompletionRequestToolMessage
| OpenAICreateCompletionNonStreamingRequest.OpenAIChatCompletionRequestFunctionMessage
| Parameters.OpenAIChatCompletionRequestSystemMessage
| Parameters.OpenAIChatCompletionRequestUserMessage
| Parameters.OpenAIChatCompletionRequestAssistantMessage
| Parameters.OpenAIChatCompletionRequestToolMessage
| Parameters.OpenAIChatCompletionRequestFunctionMessage
>;

model: string;
Expand All @@ -105,206 +103,21 @@ export namespace ModelParameters {

presence_penalty?: number | null;

response_format?: OpenAICreateCompletionNonStreamingRequest.ResponseFormat;
response_format?: Parameters.ResponseFormat;

seed?: number | null;

stop?: string | Array<string>;

stream?: false | null;

stream_options?: unknown | null;

temperature?: number | null;

tool_choice?:
| 'none'
| 'auto'
| 'required'
| OpenAICreateCompletionNonStreamingRequest.OpenAIChatCompletionNamedToolChoice;

tools?: Array<OpenAICreateCompletionNonStreamingRequest.Tool>;

top_logprobs?: number | null;

top_p?: number | null;

user?: string;
}

export namespace OpenAICreateCompletionNonStreamingRequest {
export interface OpenAIChatCompletionRequestSystemMessage {
content: string;

role: 'system';

name?: string;
}

export interface OpenAIChatCompletionRequestUserMessage {
content:
| string
| Array<
| OpenAIChatCompletionRequestUserMessage.OpenAIChatCompletionRequestMessageContentPartText
| OpenAIChatCompletionRequestUserMessage.OpenAIChatCompletionRequestMessageContentPartImage
>;

role: 'user';

name?: string;
}

export namespace OpenAIChatCompletionRequestUserMessage {
export interface OpenAIChatCompletionRequestMessageContentPartText {
text: string;

type: 'text';
}

export interface OpenAIChatCompletionRequestMessageContentPartImage {
image_url: OpenAIChatCompletionRequestMessageContentPartImage.ImageURL;

type: 'image_url';
}

export namespace OpenAIChatCompletionRequestMessageContentPartImage {
export interface ImageURL {
url: string;

detail?: 'auto' | 'low' | 'high';
}
}
}

export interface OpenAIChatCompletionRequestAssistantMessage {
role: 'assistant';

content?: string | null;

function_call?: OpenAIChatCompletionRequestAssistantMessage.FunctionCall | null;

name?: string;

tool_calls?: Array<OpenAIChatCompletionRequestAssistantMessage.ToolCall>;
}

export namespace OpenAIChatCompletionRequestAssistantMessage {
export interface FunctionCall {
arguments: string;

name: string;
}

export interface ToolCall {
id: string;

function: ToolCall.Function;

type: 'function';
}

export namespace ToolCall {
export interface Function {
arguments: string;

name: string;
}
}
}

export interface OpenAIChatCompletionRequestToolMessage {
content: string;

role: 'tool';

tool_call_id: string;
}

export interface OpenAIChatCompletionRequestFunctionMessage {
content: string | null;

name: string;

role: 'function';
}

export interface ResponseFormat {
type?: 'text' | 'json_object';
}

export interface OpenAIChatCompletionNamedToolChoice {
function: OpenAIChatCompletionNamedToolChoice.Function;

type: 'function';
}

export namespace OpenAIChatCompletionNamedToolChoice {
export interface Function {
name: string;
}
}

export interface Tool {
function: Tool.Function;

type: 'function';
}

export namespace Tool {
export interface Function {
name: string;

description?: string;

parameters?: Record<string, unknown>;
}
}
}

export interface OpenAICreateCompletionStreamingRequest {
messages: Array<
| OpenAICreateCompletionStreamingRequest.OpenAIChatCompletionRequestSystemMessage
| OpenAICreateCompletionStreamingRequest.OpenAIChatCompletionRequestUserMessage
| OpenAICreateCompletionStreamingRequest.OpenAIChatCompletionRequestAssistantMessage
| OpenAICreateCompletionStreamingRequest.OpenAIChatCompletionRequestToolMessage
| OpenAICreateCompletionStreamingRequest.OpenAIChatCompletionRequestFunctionMessage
>;

model: string;

stream: true;

frequency_penalty?: number | null;

logit_bias?: Record<string, number> | null;

logprobs?: boolean | null;

max_tokens?: number | null;

n?: number | null;

parallel_tool_calls?: boolean;

presence_penalty?: number | null;

response_format?: OpenAICreateCompletionStreamingRequest.ResponseFormat;

seed?: number | null;

stop?: string | Array<string>;
stream?: boolean | null;

stream_options?: OpenAICreateCompletionStreamingRequest.StreamOptions | null;
stream_options?: Parameters.StreamOptions | null;

temperature?: number | null;

tool_choice?:
| 'none'
| 'auto'
| 'required'
| OpenAICreateCompletionStreamingRequest.OpenAIChatCompletionNamedToolChoice;
tool_choice?: 'none' | 'auto' | 'required' | Parameters.OpenAIChatCompletionNamedToolChoice;

tools?: Array<OpenAICreateCompletionStreamingRequest.Tool>;
tools?: Array<Parameters.Tool>;

top_logprobs?: number | null;

Expand All @@ -313,7 +126,7 @@ export namespace ModelParameters {
user?: string;
}

export namespace OpenAICreateCompletionStreamingRequest {
export namespace Parameters {
export interface OpenAIChatCompletionRequestSystemMessage {
content: string;

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.3.0'; // x-release-please-version
export const VERSION = '1.4.0'; // x-release-please-version

0 comments on commit 6074d4d

Please sign in to comment.