-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.go
71 lines (60 loc) · 1.58 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright 2023 CodeMaker AI Inc. All rights reserved.
package client
const (
ModeCompletion = "COMPLETION"
ModeCode = "CODE"
ModeInlineCode = "INLINE_CODE"
ModeEditCode = "EDIT_CODE"
ModeDocument = "DOCUMENT"
ModeUnitTest = "UNIT_TEST"
ModeMigrateSyntax = "MIGRATE_SYNTAX"
ModeRefactorNaming = "REFACTOR_NAMING"
ModeFixSyntax = "FIX_SYNTAX"
StatusInProgress = "IN_PROGRESS"
StatusCompleted = "COMPLETED"
StatusFailed = "FAILED"
StatusTimedOut = "TIMED_OUT"
)
const (
LanguageC = "C"
LanguageCPP = "CPP"
LanguageJavaScript = "JAVASCRIPT"
LanguagePHP = "PHP"
LanguageJava = "JAVA"
LanguageCSharp = "CSHARP"
LanguageGo = "GO"
LanguageKotlin = "KOTLIN"
LanguageTypeScript = "TYPESCRIPT"
LanguageRust = "RUST"
)
const (
ModifyNone = "NONE"
ModifyReplace = "REPLACE"
)
type ProcessRequest struct {
Mode string `json:"mode"`
Language string `json:"language"`
Input Input `json:"input"`
Options *Options `json:"options"`
}
type ProcessResponse struct {
Source string `json:"source"`
}
type Input struct {
Source string `json:"source"`
}
type Options struct {
LanguageVersion *string `json:"languageVersion"`
Framework *string `json:"framework"`
Modify *string `json:"modify"`
CodePath *string `json:"codePath"`
ContextId *string `json:"contextId"`
Model *string `json:"model"`
}
type Output struct {
Source string `json:"source"`
}
type Error struct {
Code string `json:"code"`
Message string `json:"message"`
}