Add admin-configurable tool-call prices with cross-provider surcharge settlement, Sub2API channel support, /v1/alpha/search relay, and usage-log surcharge UI.
27 lines
718 B
Go
27 lines
718 B
Go
package codex
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/QuantumNous/new-api/constant"
|
|
relaycommon "github.com/QuantumNous/new-api/relay/common"
|
|
relayconstant "github.com/QuantumNous/new-api/relay/constant"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetRequestURLAlphaSearch(t *testing.T) {
|
|
adaptor := &Adaptor{}
|
|
info := &relaycommon.RelayInfo{
|
|
ChannelMeta: &relaycommon.ChannelMeta{
|
|
ChannelType: constant.ChannelTypeCodex,
|
|
ChannelBaseUrl: "https://chatgpt.com",
|
|
},
|
|
RelayMode: relayconstant.RelayModeAlphaSearch,
|
|
}
|
|
|
|
url, err := adaptor.GetRequestURL(info)
|
|
require.NoError(t, err)
|
|
assert.Equal(t, "https://chatgpt.com/backend-api/codex/alpha/search", url)
|
|
}
|