Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cdd58282
authored
Apr 10, 2025
by
HynoR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update adaptor methods and add new image model
parent
5c1386af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
relay/channel/xai/adaptor.go
+8
-8
relay/channel/xai/constants.go
+3
-1
No files found.
relay/channel/xai/adaptor.go
View file @
cdd58282
...
...
@@ -18,18 +18,18 @@ type Adaptor struct {
func
(
a
*
Adaptor
)
ConvertClaudeRequest
(
*
gin
.
Context
,
*
relaycommon
.
RelayInfo
,
*
dto
.
ClaudeRequest
)
(
any
,
error
)
{
//TODO implement me
panic
(
"implement me"
)
return
nil
,
nil
//
panic("implement me")
return
nil
,
errors
.
New
(
"not available"
)
}
func
(
a
*
Adaptor
)
ConvertAudioRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
request
dto
.
AudioRequest
)
(
io
.
Reader
,
error
)
{
//
TODO implement m
e
return
nil
,
errors
.
New
(
"not
implemented
"
)
//
not availabl
e
return
nil
,
errors
.
New
(
"not
available
"
)
}
func
(
a
*
Adaptor
)
ConvertImageRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
request
dto
.
ImageRequest
)
(
any
,
error
)
{
//TODO implement me
return
nil
,
errors
.
New
(
"not implemented"
)
request
.
Size
=
""
return
request
,
nil
}
func
(
a
*
Adaptor
)
Init
(
info
*
relaycommon
.
RelayInfo
)
{
...
...
@@ -76,8 +76,8 @@ func (a *Adaptor) ConvertRerankRequest(c *gin.Context, relayMode int, request dt
}
func
(
a
*
Adaptor
)
ConvertEmbeddingRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
request
dto
.
EmbeddingRequest
)
(
any
,
error
)
{
//
TODO implement m
e
return
nil
,
errors
.
New
(
"not
implemented
"
)
//
not availabl
e
return
nil
,
errors
.
New
(
"not
available
"
)
}
func
(
a
*
Adaptor
)
DoRequest
(
c
*
gin
.
Context
,
info
*
relaycommon
.
RelayInfo
,
requestBody
io
.
Reader
)
(
any
,
error
)
{
...
...
relay/channel/xai/constants.go
View file @
cdd58282
...
...
@@ -8,7 +8,9 @@ var ModelList = []string{
// extend grok-3-mini reasoning
"grok-3-mini-beta-high"
,
"grok-3-mini-beta-low"
,
"grok-3-mini-beta-medium"
,
"grok-3-mini-fast-beta-high"
,
"grok-3-mini-fast-beta-low"
,
"grok-3-mini-fast-beta-medium"
,
// image model
"grok-2-image"
,
// legacy models
"grok-2"
,
"grok-2-vision"
,
"grok-beta"
,
"grok-vision-beta"
,
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment