diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 222c065ce..605690056 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,23 +1,14 @@ -A similar PR may already be submitted! -Please search among the [Pull request](https://github.com/sashabaranov/go-openai/pulls) before creating one. - -If your changes introduce breaking changes, please prefix the title of your pull request with "[BREAKING_CHANGES]". This allows for clear identification of such changes in the 'What's Changed' section on the release page, making it developer-friendly. - -Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. - **Describe the change** -Please provide a clear and concise description of the changes you're proposing. Explain what problem it solves or what feature it adds. + **Provide OpenAI documentation link** -Provide a relevant API doc from https://platform.openai.com/docs/api-reference + **Describe your solution** -Describe how your changes address the problem or how they add the feature. This should include a brief description of your approach and any new libraries or dependencies you're using. + **Tests** -Briefly describe how you have tested these changes. If possible — please add integration tests. + **Additional context** -Add any other context or screenshots or logs about your pull request here. If the pull request relates to an open issue, please link to it. - -Issue: #XXXX + diff --git a/README.md b/README.md index 77b85e519..a7bf6a681 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +# Github Forked Branch Rules +`master` - kept in sync with main repository. Do not merge anything into this branch other than sync code. +`develop` - default branch of this forked repository. Merge all PRs into this branch. +`release` - only release from this branch. Merge the `develop` into `release` branch before doing a tagged release. + # Go OpenAI [![Go Reference](https://pkg.go.dev/badge/github.com/sashabaranov/go-openai.svg)](https://pkg.go.dev/github.com/sashabaranov/go-openai) [![Go Report Card](https://goreportcard.com/badge/github.com/sashabaranov/go-openai)](https://goreportcard.com/report/github.com/sashabaranov/go-openai) diff --git a/chat.go b/chat.go index 0aa018715..f1b77ba30 100644 --- a/chat.go +++ b/chat.go @@ -119,6 +119,9 @@ type ChatCompletionMessage struct { // For Role=tool prompts this should be set to the ID given in the assistant's prior request to call a tool. ToolCallID string `json:"tool_call_id,omitempty"` + + // Messari custom fields + Prefix bool `json:"prefix,omitempty"` } func (m ChatCompletionMessage) MarshalJSON() ([]byte, error) { @@ -136,6 +139,7 @@ func (m ChatCompletionMessage) MarshalJSON() ([]byte, error) { FunctionCall *FunctionCall `json:"function_call,omitempty"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` ToolCallID string `json:"tool_call_id,omitempty"` + Prefix bool `json:"prefix,omitempty"` }(m) return json.Marshal(msg) } @@ -150,6 +154,7 @@ func (m ChatCompletionMessage) MarshalJSON() ([]byte, error) { FunctionCall *FunctionCall `json:"function_call,omitempty"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` ToolCallID string `json:"tool_call_id,omitempty"` + Prefix bool `json:"prefix,omitempty"` }(m) return json.Marshal(msg) } @@ -165,6 +170,7 @@ func (m *ChatCompletionMessage) UnmarshalJSON(bs []byte) error { FunctionCall *FunctionCall `json:"function_call,omitempty"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` ToolCallID string `json:"tool_call_id,omitempty"` + Prefix bool `json:"prefix,omitempty"` }{} if err := json.Unmarshal(bs, &msg); err == nil { @@ -181,6 +187,7 @@ func (m *ChatCompletionMessage) UnmarshalJSON(bs []byte) error { FunctionCall *FunctionCall `json:"function_call,omitempty"` ToolCalls []ToolCall `json:"tool_calls,omitempty"` ToolCallID string `json:"tool_call_id,omitempty"` + Prefix bool `json:"prefix,omitempty"` }{} if err := json.Unmarshal(bs, &multiMsg); err != nil { return err @@ -195,6 +202,7 @@ type ToolCall struct { ID string `json:"id,omitempty"` Type ToolType `json:"type"` Function FunctionCall `json:"function"` + Name string `json:"name,omitempty"` } type FunctionCall struct { diff --git a/messages.go b/messages.go index 3852d2e37..538833f54 100644 --- a/messages.go +++ b/messages.go @@ -24,6 +24,9 @@ type Message struct { Metadata map[string]any `json:"metadata"` httpHeader + + // Messari custom fields + Prefix bool `json:"prefix,omitempty"` } type MessagesList struct {