diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e36c38239..9f25acc17 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ # These are supported funding model platforms -github: [sashabaranov, vvatanabe] +github: [lookfirst-io, vvatanabe] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 536a2ee29..14305e816 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,7 +8,7 @@ assignees: '' --- Your issue may already be reported! -Please search on the [issue tracker](https://github.com/sashabaranov/go-openai/issues) before creating one. +Please search on the [issue tracker](https://github.com/lookfirst-io/go-openai/issues) before creating one. **Describe the bug** A clear and concise description of what the bug is. If it's an API-related bug, please provide relevant endpoint(s). diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2359e5c00..b40b9a039 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -8,7 +8,7 @@ assignees: '' --- Your issue may already be reported! -Please search on the [issue tracker](https://github.com/sashabaranov/go-openai/issues) before creating one. +Please search on the [issue tracker](https://github.com/lookfirst-io/go-openai/issues) before creating one. **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 222c065ce..1393a453f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ A similar PR may already be submitted! -Please search among the [Pull request](https://github.com/sashabaranov/go-openai/pulls) before creating one. +Please search among the [Pull request](https://github.com/lookfirst-io/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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4dd184042..8427a2d4c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,22 +1,22 @@ # Contributing Guidelines ## Overview -Thank you for your interest in contributing to the "Go OpenAI" project! By following this guideline, we hope to ensure that your contributions are made smoothly and efficiently. The Go OpenAI project is licensed under the [Apache 2.0 License](https://github.com/sashabaranov/go-openai/blob/master/LICENSE), and we welcome contributions through GitHub pull requests. +Thank you for your interest in contributing to the "Go OpenAI" project! By following this guideline, we hope to ensure that your contributions are made smoothly and efficiently. The Go OpenAI project is licensed under the [Apache 2.0 License](https://github.com/lookfirst-io/go-openai/blob/master/LICENSE), and we welcome contributions through GitHub pull requests. ## Reporting Bugs -If you discover a bug, first check the [GitHub Issues page](https://github.com/sashabaranov/go-openai/issues) to see if the issue has already been reported. If you're reporting a new issue, please use the "Bug report" template and provide detailed information about the problem, including steps to reproduce it. +If you discover a bug, first check the [GitHub Issues page](https://github.com/lookfirst-io/go-openai/issues) to see if the issue has already been reported. If you're reporting a new issue, please use the "Bug report" template and provide detailed information about the problem, including steps to reproduce it. ## Suggesting Features -If you want to suggest a new feature or improvement, first check the [GitHub Issues page](https://github.com/sashabaranov/go-openai/issues) to ensure a similar suggestion hasn't already been made. Use the "Feature request" template to provide a detailed description of your suggestion. +If you want to suggest a new feature or improvement, first check the [GitHub Issues page](https://github.com/lookfirst-io/go-openai/issues) to ensure a similar suggestion hasn't already been made. Use the "Feature request" template to provide a detailed description of your suggestion. ## Reporting Vulnerabilities -If you identify a security concern, please use the "Report a security vulnerability" template on the [GitHub Issues page](https://github.com/sashabaranov/go-openai/issues) to share the details. This report will only be viewable to repository maintainers. You will be credited if the advisory is published. +If you identify a security concern, please use the "Report a security vulnerability" template on the [GitHub Issues page](https://github.com/lookfirst-io/go-openai/issues) to share the details. This report will only be viewable to repository maintainers. You will be credited if the advisory is published. ## Questions for Users -If you have questions, please utilize [StackOverflow](https://stackoverflow.com/) or the [GitHub Discussions page](https://github.com/sashabaranov/go-openai/discussions). +If you have questions, please utilize [StackOverflow](https://stackoverflow.com/) or the [GitHub Discussions page](https://github.com/lookfirst-io/go-openai/discussions). ## Contributing Code -There might already be a similar pull requests submitted! Please search for [pull requests](https://github.com/sashabaranov/go-openai/pulls) before creating one. +There might already be a similar pull requests submitted! Please search for [pull requests](https://github.com/lookfirst-io/go-openai/pulls) before creating one. ### Requirements for Merging a Pull Request diff --git a/README.md b/README.md index 77b85e519..5eff86f0e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 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) -[![codecov](https://codecov.io/gh/sashabaranov/go-openai/branch/master/graph/badge.svg?token=bCbIfHLIsW)](https://codecov.io/gh/sashabaranov/go-openai) +[![Go Reference](https://pkg.go.dev/badge/github.com/lookfirst-io/go-openai.svg)](https://pkg.go.dev/github.com/lookfirst-io/go-openai) +[![Go Report Card](https://goreportcard.com/badge/github.com/lookfirst-io/go-openai)](https://goreportcard.com/report/github.com/lookfirst-io/go-openai) +[![codecov](https://codecov.io/gh/lookfirst-io/go-openai/branch/master/graph/badge.svg?token=bCbIfHLIsW)](https://codecov.io/gh/lookfirst-io/go-openai) This library provides unofficial Go clients for [OpenAI API](https://platform.openai.com/). We support: @@ -13,7 +13,7 @@ This library provides unofficial Go clients for [OpenAI API](https://platform.op ## Installation ``` -go get github.com/sashabaranov/go-openai +go get github.com/lookfirst-io/go-openai ``` Currently, go-openai requires Go version 1.18 or greater. @@ -28,7 +28,7 @@ package main import ( "context" "fmt" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -80,7 +80,7 @@ import ( "errors" "fmt" "io" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -133,7 +133,7 @@ package main import ( "context" "fmt" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -166,7 +166,7 @@ import ( "context" "fmt" "io" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -215,7 +215,7 @@ import ( "context" "fmt" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -247,7 +247,7 @@ import ( "fmt" "os" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -288,7 +288,7 @@ import ( "context" "encoding/base64" "fmt" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" "image/png" "os" ) @@ -436,7 +436,7 @@ config.HTTPClient = &http.Client{ c := openai.NewClientWithConfig(config) ``` -See also: https://pkg.go.dev/github.com/sashabaranov/go-openai#ClientConfig +See also: https://pkg.go.dev/github.com/lookfirst-io/go-openai#ClientConfig
@@ -452,7 +452,7 @@ import ( "os" "strings" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func main() { @@ -506,7 +506,7 @@ import ( "context" "fmt" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -552,7 +552,7 @@ package main import ( "context" "log" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) @@ -609,7 +609,7 @@ import ( "context" "fmt" - openai "github.com/sashabaranov/go-openai" + openai "github.com/lookfirst-io/go-openai" ) func main() { @@ -740,7 +740,7 @@ package main import ( "context" "fmt" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func main() { @@ -888,7 +888,7 @@ Due to the factors mentioned above, different answers may be returned even for t By adopting these strategies, you can expect more consistent results. **Related Issues:** -[omitempty option of request struct will generate incorrect request when parameter is 0.](https://github.com/sashabaranov/go-openai/issues/9) +[omitempty option of request struct will generate incorrect request when parameter is 0.](https://github.com/lookfirst-io/go-openai/issues/9) ### Does Go OpenAI provide a method to count tokens? @@ -899,15 +899,15 @@ For counting tokens, you might find the following links helpful: - [How to count tokens with tiktoken](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) **Related Issues:** -[Is it possible to join the implementation of GPT3 Tokenizer](https://github.com/sashabaranov/go-openai/issues/62) +[Is it possible to join the implementation of GPT3 Tokenizer](https://github.com/lookfirst-io/go-openai/issues/62) ## Contributing -By following [Contributing Guidelines](https://github.com/sashabaranov/go-openai/blob/master/CONTRIBUTING.md), we hope to ensure that your contributions are made smoothly and efficiently. +By following [Contributing Guidelines](https://github.com/lookfirst-io/go-openai/blob/master/CONTRIBUTING.md), we hope to ensure that your contributions are made smoothly and efficiently. ## Thank you -We want to take a moment to express our deepest gratitude to the [contributors](https://github.com/sashabaranov/go-openai/graphs/contributors) and sponsors of this project: +We want to take a moment to express our deepest gratitude to the [contributors](https://github.com/lookfirst-io/go-openai/graphs/contributors) and sponsors of this project: - [Carson Kahn](https://carsonkahn.com) of [Spindle AI](https://spindleai.com) To all of you: thank you. You've helped us achieve more than we ever imagined possible. Can't wait to see where we go next, together! diff --git a/api_integration_test.go b/api_integration_test.go index 7828d9451..580961189 100644 --- a/api_integration_test.go +++ b/api_integration_test.go @@ -10,9 +10,9 @@ import ( "os" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" - "github.com/sashabaranov/go-openai/jsonschema" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai/jsonschema" ) func TestAPI(t *testing.T) { diff --git a/assistant_test.go b/assistant_test.go index 40de0e50f..89a6d0484 100644 --- a/assistant_test.go +++ b/assistant_test.go @@ -3,8 +3,8 @@ package openai_test import ( "context" - openai "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + openai "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" "encoding/json" "fmt" diff --git a/audio.go b/audio.go index f321f93d6..c313f521b 100644 --- a/audio.go +++ b/audio.go @@ -8,7 +8,7 @@ import ( "net/http" "os" - utils "github.com/sashabaranov/go-openai/internal" + utils "github.com/lookfirst-io/go-openai/internal" ) // Whisper Defines the models provided by OpenAI to use when processing audio with OpenAI. diff --git a/audio_api_test.go b/audio_api_test.go index 6c6a35643..d983432e9 100644 --- a/audio_api_test.go +++ b/audio_api_test.go @@ -12,9 +12,9 @@ import ( "strings" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) // TestAudio Tests the transcription and translation endpoints of the API using the mocked server. diff --git a/chat.go b/chat.go index 0f0c5b5d5..1290e418f 100644 --- a/chat.go +++ b/chat.go @@ -262,6 +262,9 @@ type ChatCompletionRequest struct { MaxCompletionTokens int `json:"max_completion_tokens,omitempty"` Temperature float32 `json:"temperature,omitempty"` TopP float32 `json:"top_p,omitempty"` + MinP float32 `json:"min_p,omitempty"` + TopK int32 `json:"top_k,omitempty"` + RepetitionPenalty float64 `json:"repetition_penalty,omitempty"` N int `json:"n,omitempty"` Stream bool `json:"stream,omitempty"` Stop []string `json:"stop,omitempty"` @@ -309,6 +312,35 @@ type ChatCompletionRequest struct { ChatTemplateKwargs map[string]any `json:"chat_template_kwargs,omitempty"` // Specifies the latency tier to use for processing the request. ServiceTier ServiceTier `json:"service_tier,omitempty"` + + Provider *PostOpenrouterProviderRequest `json:"provider,omitempty"` + + IncludeReasoning bool `json:"include_reasoning,omitempty"` // Whether to include reasoning in the response for OpenRouter + Reasoning *PostOpenrouterReasoningRequest `json:"reasoning,omitempty"` +} + +type PostOpenrouterProviderRequest struct { + Sort string `json:"sort,omitempty"` // Sort providers by price or throughput. (e.g. "price" or "throughput") + Quantizations []string `json:"quantizations,omitempty"` // List of quantization levels to filter by (e.g. ["int4", "int8"]) + Ignore []string `json:"ignore,omitempty"` // List of provider names to skip for this request. + DataCollection string `json:"data_collection,omitempty"` // Control whether to use providers that may store data. "deny" or "allow" + RequireParameters bool `json:"require_parameters,omitempty"` // Only use providers that support all parameters in your request. + AllowFallbacks bool `json:"allow_fallbacks,omitempty"` // Whether to allow backup providers when the primary is unavailable. + Order []string `json:"order,omitempty"` // List of provider names to try in order + Only []string `json:"only,omitempty"` // List of provider slugs to allow for this request. +} + +// context : https://openrouter.ai/docs/use-cases/reasoning-tokens +type PostOpenrouterReasoningRequest struct { + // One of the following (not both): + Effort string `json:"effort,omitempty"` // Can be "high", "medium", or "low" (OpenAI-style) + MaxTokens int `json:"max_tokens,omitempty"` // Specific token limit (Anthropic-style) + + // Optional: Default is false. All models support this. + Exclude bool `json:"exclude"` // // Set to true to exclude reasoning tokens from response + + // Or enable reasoning with the default parameters: + Enabled bool `json:"enabled"` // Default: inferred from `effort` or `max_tokens` } type StreamOptions struct { @@ -435,6 +467,8 @@ type ChatCompletionResponse struct { PromptFilterResults []PromptFilterResult `json:"prompt_filter_results,omitempty"` ServiceTier ServiceTier `json:"service_tier,omitempty"` + Provider string `json:"provider"` + httpHeader } diff --git a/chat_stream.go b/chat_stream.go index 80d16cc63..0a3c2ec08 100644 --- a/chat_stream.go +++ b/chat_stream.go @@ -63,6 +63,8 @@ type ChatCompletionStreamResponse struct { // When present, it contains a null value except for the last chunk which contains the token usage statistics // for the entire request. Usage *Usage `json:"usage,omitempty"` + + Provider string `json:"provider"` } // ChatCompletionStream diff --git a/chat_stream_test.go b/chat_stream_test.go index eabb0f3a2..f5eebf53d 100644 --- a/chat_stream_test.go +++ b/chat_stream_test.go @@ -10,8 +10,8 @@ import ( "strconv" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestChatCompletionsStreamWrongModel(t *testing.T) { diff --git a/chat_test.go b/chat_test.go index 172ce0740..a8d919d1d 100644 --- a/chat_test.go +++ b/chat_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" - "github.com/sashabaranov/go-openai/jsonschema" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai/jsonschema" ) const ( diff --git a/client.go b/client.go index 413b8db03..c34473c75 100644 --- a/client.go +++ b/client.go @@ -10,7 +10,7 @@ import ( "net/url" "strings" - utils "github.com/sashabaranov/go-openai/internal" + utils "github.com/lookfirst-io/go-openai/internal" ) // Client is OpenAI GPT-3 API client. diff --git a/client_test.go b/client_test.go index 321971445..407f997de 100644 --- a/client_test.go +++ b/client_test.go @@ -10,8 +10,8 @@ import ( "reflect" "testing" - "github.com/sashabaranov/go-openai/internal/test" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai/internal/test" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) var errTestRequestBuilderFailed = errors.New("test request builder failed") diff --git a/completion.go b/completion.go index 02ce7b016..cb9003d59 100644 --- a/completion.go +++ b/completion.go @@ -214,9 +214,18 @@ type CompletionRequest struct { Suffix string `json:"suffix,omitempty"` Temperature float32 `json:"temperature,omitempty"` TopP float32 `json:"top_p,omitempty"` + MinP float32 `json:"min_p,omitempty"` User string `json:"user,omitempty"` // Options for streaming response. Only set this when you set stream: true. StreamOptions *StreamOptions `json:"stream_options,omitempty"` + + TopK int32 `json:"top_k,omitempty"` + RepetitionPenalty float64 `json:"repetition_penalty,omitempty"` + + Provider *PostOpenrouterProviderRequest `json:"provider,omitempty"` + + IncludeReasoning bool `json:"include_reasoning,omitempty"` // Whether to include reasoning in the response for OpenRouter + Reasoning *PostOpenrouterReasoningRequest `json:"reasoning,omitempty"` } // CompletionChoice represents one of possible completions. @@ -244,6 +253,8 @@ type CompletionResponse struct { Choices []CompletionChoice `json:"choices"` Usage *Usage `json:"usage,omitempty"` + Provider string `json:"provider"` + httpHeader } diff --git a/completion_test.go b/completion_test.go index f0ead0d63..7223ee85a 100644 --- a/completion_test.go +++ b/completion_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestCompletionsWrongModel(t *testing.T) { diff --git a/config_test.go b/config_test.go index 960230804..a25d8a962 100644 --- a/config_test.go +++ b/config_test.go @@ -3,7 +3,7 @@ package openai_test import ( "testing" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func TestGetAzureDeploymentByModel(t *testing.T) { diff --git a/edits.go b/edits.go index fe8ecd0c1..70640d3df 100644 --- a/edits.go +++ b/edits.go @@ -14,6 +14,7 @@ type EditsRequest struct { N int `json:"n,omitempty"` Temperature float32 `json:"temperature,omitempty"` TopP float32 `json:"top_p,omitempty"` + MinP float32 `json:"min_p,omitempty"` } // EditsChoice represents one of possible edits. diff --git a/edits_test.go b/edits_test.go index d2a6db40d..363c8cedd 100644 --- a/edits_test.go +++ b/edits_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) // TestEdits Tests the edits endpoint of the API using the mocked server. diff --git a/embeddings_test.go b/embeddings_test.go index 07f1262cb..1eeec562e 100644 --- a/embeddings_test.go +++ b/embeddings_test.go @@ -11,8 +11,8 @@ import ( "reflect" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestEmbedding(t *testing.T) { diff --git a/engines_test.go b/engines_test.go index d26aa5541..db7bd45c2 100644 --- a/engines_test.go +++ b/engines_test.go @@ -7,8 +7,8 @@ import ( "net/http" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) // TestGetEngine Tests the retrieve engine endpoint of the API using the mocked server. diff --git a/error.go b/error.go index 8a74bd52c..285e45e75 100644 --- a/error.go +++ b/error.go @@ -54,7 +54,7 @@ func (e *APIError) UnmarshalJSON(data []byte) (err error) { err = json.Unmarshal(rawMap["message"], &e.Message) if err != nil { // If the parameter field of a function call is invalid as a JSON schema - // refs: https://github.com/sashabaranov/go-openai/issues/381 + // refs: https://github.com/lookfirst-io/go-openai/issues/381 var messages []string err = json.Unmarshal(rawMap["message"], &messages) if err != nil { @@ -64,7 +64,7 @@ func (e *APIError) UnmarshalJSON(data []byte) (err error) { } // optional fields for azure openai - // refs: https://github.com/sashabaranov/go-openai/issues/343 + // refs: https://github.com/lookfirst-io/go-openai/issues/343 if _, ok := rawMap["type"]; ok { err = json.Unmarshal(rawMap["type"], &e.Type) if err != nil { diff --git a/error_test.go b/error_test.go index 48cbe4f29..8d5f9e0c7 100644 --- a/error_test.go +++ b/error_test.go @@ -6,7 +6,7 @@ import ( "reflect" "testing" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func TestAPIErrorUnmarshalJSON(t *testing.T) { diff --git a/example_test.go b/example_test.go index 5910ffb84..9dd7ba989 100644 --- a/example_test.go +++ b/example_test.go @@ -11,7 +11,7 @@ import ( "net/url" "os" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func Example() { diff --git a/examples/chatbot/main.go b/examples/chatbot/main.go index ad41e957d..138874221 100644 --- a/examples/chatbot/main.go +++ b/examples/chatbot/main.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func main() { diff --git a/examples/completion-with-tool/main.go b/examples/completion-with-tool/main.go index 26126e41b..973f07541 100644 --- a/examples/completion-with-tool/main.go +++ b/examples/completion-with-tool/main.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/jsonschema" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/jsonschema" ) func main() { diff --git a/examples/completion/main.go b/examples/completion/main.go index 8c5cbd5ca..7a483daab 100644 --- a/examples/completion/main.go +++ b/examples/completion/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func main() { diff --git a/examples/images/main.go b/examples/images/main.go index 5ee649d22..bd0d980ee 100644 --- a/examples/images/main.go +++ b/examples/images/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func main() { diff --git a/examples/voice-to-text/main.go b/examples/voice-to-text/main.go index 713e748e1..f767039d5 100644 --- a/examples/voice-to-text/main.go +++ b/examples/voice-to-text/main.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/sashabaranov/go-openai" + "github.com/lookfirst-io/go-openai" ) func main() { diff --git a/files_api_test.go b/files_api_test.go index aa4fda458..b72bd8e7f 100644 --- a/files_api_test.go +++ b/files_api_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestFileBytesUpload(t *testing.T) { diff --git a/files_test.go b/files_test.go index 486ef892e..d116e7b3f 100644 --- a/files_test.go +++ b/files_test.go @@ -7,8 +7,8 @@ import ( "os" "testing" - utils "github.com/sashabaranov/go-openai/internal" - "github.com/sashabaranov/go-openai/internal/test/checks" + utils "github.com/lookfirst-io/go-openai/internal" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestFileBytesUploadWithFailingFormBuilder(t *testing.T) { diff --git a/fine_tunes_test.go b/fine_tunes_test.go index 2ab6817f7..ef10e5b13 100644 --- a/fine_tunes_test.go +++ b/fine_tunes_test.go @@ -7,8 +7,8 @@ import ( "net/http" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) const testFineTuneID = "fine-tune-id" diff --git a/fine_tuning_job_test.go b/fine_tuning_job_test.go index 5f63ef24c..293fea4f0 100644 --- a/fine_tuning_job_test.go +++ b/fine_tuning_job_test.go @@ -7,8 +7,8 @@ import ( "net/http" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) const testFineTuninigJobID = "fine-tuning-job-id" diff --git a/go.mod b/go.mod index 42cc7b391..0b8b631af 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/sashabaranov/go-openai +module github.com/lookfirst-io/go-openai go 1.18 diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..e69de29bb diff --git a/image_api_test.go b/image_api_test.go index f6057b77d..8a27d288b 100644 --- a/image_api_test.go +++ b/image_api_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestImages(t *testing.T) { diff --git a/image_test.go b/image_test.go index c2c8f42dc..b25251bb9 100644 --- a/image_test.go +++ b/image_test.go @@ -1,8 +1,8 @@ package openai //nolint:testpackage // testing private field import ( - utils "github.com/sashabaranov/go-openai/internal" - "github.com/sashabaranov/go-openai/internal/test/checks" + utils "github.com/lookfirst-io/go-openai/internal" + "github.com/lookfirst-io/go-openai/internal/test/checks" "bytes" "context" diff --git a/internal/test/helpers.go b/internal/test/helpers.go index dc5fa6646..91eebc405 100644 --- a/internal/test/helpers.go +++ b/internal/test/helpers.go @@ -1,7 +1,7 @@ package test import ( - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai/internal/test/checks" "net/http" "os" diff --git a/jsonschema/json_test.go b/jsonschema/json_test.go index 34f5d88eb..da3f5fe5e 100644 --- a/jsonschema/json_test.go +++ b/jsonschema/json_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - "github.com/sashabaranov/go-openai/jsonschema" + "github.com/lookfirst-io/go-openai/jsonschema" ) func TestDefinition_MarshalJSON(t *testing.T) { diff --git a/models_test.go b/models_test.go index 7fd010c34..2dbaa43c8 100644 --- a/models_test.go +++ b/models_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) const testFineTuneModelID = "fine-tune-model-id" diff --git a/moderation_test.go b/moderation_test.go index a97f25bc6..a539c1897 100644 --- a/moderation_test.go +++ b/moderation_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) // TestModeration Tests the moderations endpoint of the API using the mocked server. diff --git a/openai_test.go b/openai_test.go index a55f3a858..3f947e717 100644 --- a/openai_test.go +++ b/openai_test.go @@ -1,8 +1,8 @@ package openai_test import ( - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test" ) func setupOpenAITestServer() (client *openai.Client, server *test.ServerTest, teardown func()) { diff --git a/run_test.go b/run_test.go index cdf99db05..b1474ced3 100644 --- a/run_test.go +++ b/run_test.go @@ -3,8 +3,8 @@ package openai_test import ( "context" - openai "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + openai "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" "encoding/json" "fmt" diff --git a/speech_test.go b/speech_test.go index 67a3feabc..87cd323bf 100644 --- a/speech_test.go +++ b/speech_test.go @@ -11,9 +11,9 @@ import ( "path/filepath" "testing" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestSpeechIntegration(t *testing.T) { diff --git a/stream.go b/stream.go index a61c7c970..791265505 100644 --- a/stream.go +++ b/stream.go @@ -23,10 +23,10 @@ func (c *Client) CreateCompletionStream( request CompletionRequest, ) (stream *CompletionStream, err error) { urlSuffix := "/completions" - if !checkEndpointSupportsModel(urlSuffix, request.Model) { - err = ErrCompletionUnsupportedModel - return - } + //if !checkEndpointSupportsModel(urlSuffix, request.Model) { + // err = ErrCompletionUnsupportedModel + // return + //} if !checkPromptType(request.Prompt) { err = ErrCompletionRequestPromptTypeNotSupported diff --git a/stream_reader.go b/stream_reader.go index 6faefe0a7..eba5f691c 100644 --- a/stream_reader.go +++ b/stream_reader.go @@ -8,7 +8,7 @@ import ( "net/http" "regexp" - utils "github.com/sashabaranov/go-openai/internal" + utils "github.com/lookfirst-io/go-openai/internal" ) var ( diff --git a/stream_reader_test.go b/stream_reader_test.go index 449a14b43..7b98e19eb 100644 --- a/stream_reader_test.go +++ b/stream_reader_test.go @@ -6,9 +6,9 @@ import ( "errors" "testing" - utils "github.com/sashabaranov/go-openai/internal" - "github.com/sashabaranov/go-openai/internal/test" - "github.com/sashabaranov/go-openai/internal/test/checks" + utils "github.com/lookfirst-io/go-openai/internal" + "github.com/lookfirst-io/go-openai/internal/test" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) var errTestUnmarshalerFailed = errors.New("test unmarshaler failed") diff --git a/stream_test.go b/stream_test.go index 9dd95bb5f..27c61f662 100644 --- a/stream_test.go +++ b/stream_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) func TestCompletionsStreamWrongModel(t *testing.T) { diff --git a/thread_test.go b/thread_test.go index 1ac0f3c0e..967433b34 100644 --- a/thread_test.go +++ b/thread_test.go @@ -7,8 +7,8 @@ import ( "net/http" "testing" - openai "github.com/sashabaranov/go-openai" - "github.com/sashabaranov/go-openai/internal/test/checks" + openai "github.com/lookfirst-io/go-openai" + "github.com/lookfirst-io/go-openai/internal/test/checks" ) // TestThread Tests the thread endpoint of the API using the mocked server.