Skip to content

Commit f403ead

Browse files
committed
feat: add AI conversation management endpoints and update related schemas
1 parent 94c0308 commit f403ead

13 files changed

Lines changed: 3106 additions & 319 deletions

File tree

docs/docs.go

Lines changed: 1176 additions & 146 deletions
Large diffs are not rendered by default.

docs/swagger.json

Lines changed: 1176 additions & 146 deletions
Large diffs are not rendered by default.

docs/swagger.yaml

Lines changed: 628 additions & 0 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ require (
3030
github.com/go-playground/locales v0.14.1
3131
github.com/go-playground/universal-translator v0.18.1
3232
github.com/go-playground/validator/v10 v10.22.1
33+
github.com/go-resty/resty/v2 v2.17.1
3334
github.com/go-sql-driver/mysql v1.8.1
3435
github.com/goccy/go-json v0.10.3
3536
github.com/google/uuid v1.6.0
@@ -39,10 +40,12 @@ require (
3940
github.com/jinzhu/now v1.1.5
4041
github.com/joho/godotenv v1.5.1
4142
github.com/lib/pq v1.10.9
43+
github.com/mark3labs/mcp-go v0.43.2
4244
github.com/microcosm-cc/bluemonday v1.0.27
4345
github.com/mozillazg/go-pinyin v0.20.0
4446
github.com/ory/dockertest/v3 v3.11.0
4547
github.com/robfig/cron/v3 v3.0.1
48+
github.com/sashabaranov/go-openai v1.41.2
4649
github.com/scottleedavis/go-exif-remove v0.0.0-20230314195146-7e059d593405
4750
github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f
4851
github.com/segmentfault/pacman/contrib/cache/memory v0.0.0-20230822083413-c0075a2d401f
@@ -80,6 +83,8 @@ require (
8083
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
8184
github.com/andybalholm/brotli v1.1.0 // indirect
8285
github.com/aymerick/douceur v0.2.0 // indirect
86+
github.com/bahlo/generic-list-go v0.2.0 // indirect
87+
github.com/buger/jsonparser v1.1.1 // indirect
8388
github.com/bytedance/sonic v1.12.2 // indirect
8489
github.com/bytedance/sonic/loader v0.2.0 // indirect
8590
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
@@ -118,6 +123,7 @@ require (
118123
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
119124
github.com/hashicorp/hcl v1.0.0 // indirect
120125
github.com/inconshreveable/mousetrap v1.1.0 // indirect
126+
github.com/invopop/jsonschema v0.13.0 // indirect
121127
github.com/josharian/intern v1.0.0 // indirect
122128
github.com/json-iterator/go v1.1.12 // indirect
123129
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
@@ -146,7 +152,7 @@ require (
146152
github.com/sirupsen/logrus v1.9.3 // indirect
147153
github.com/sourcegraph/conc v0.3.0 // indirect
148154
github.com/spf13/afero v1.11.0 // indirect
149-
github.com/spf13/cast v1.7.0 // indirect
155+
github.com/spf13/cast v1.7.1 // indirect
150156
github.com/spf13/pflag v1.0.5 // indirect
151157
github.com/spf13/viper v1.19.0 // indirect
152158
github.com/subosito/gotenv v1.6.0 // indirect
@@ -155,9 +161,11 @@ require (
155161
github.com/tidwall/pretty v1.2.1 // indirect
156162
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
157163
github.com/ugorji/go/codec v1.2.12 // indirect
164+
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
158165
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
159166
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
160167
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
168+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
161169
go.uber.org/multierr v1.11.0 // indirect
162170
go.uber.org/zap v1.27.0 // indirect
163171
golang.org/x/arch v0.10.0 // indirect

internal/base/constant/site_type.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const (
4242
SiteTypeUsersSettings = "users_settings"
4343
SiteTypeInterfaceSettings = "interface_settings"
4444

45-
SiteTypePolicies = "policies"
46-
SiteTypeSecurity = "security"
45+
SiteTypePolicies = "policies"
46+
SiteTypeSecurity = "security"
4747
SiteTypeAI = "ai"
4848
SiteTypeFeatureToggle = "feature-toggle"
4949
SiteTypeMCP = "mcp"

internal/schema/siteinfo_schema.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ type SiteInfoResp struct {
381381
Security *SiteSecurityResp `json:"site_security"`
382382
Version string `json:"version"`
383383
Revision string `json:"revision"`
384-
AIEnabled bool `json:"ai_enabled"`
385-
MCPEnabled bool `json:"mcp_enabled"`
384+
AIEnabled bool `json:"ai_enabled"`
385+
MCPEnabled bool `json:"mcp_enabled"`
386386
}
387387

388388
type TemplateSiteInfoResp struct {

internal/service/mock/siteinfo_repo_mock.go

Lines changed: 54 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src/components/TabNav/index.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
120
import { FC } from 'react';
221
import { Nav } from 'react-bootstrap';
322
import { NavLink, useLocation } from 'react-router-dom';

ui/src/pages/Admin/AiAssistant/components/Action/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
1920
import { Dropdown } from 'react-bootstrap';
2021
import { useTranslation } from 'react-i18next';
2122

0 commit comments

Comments
 (0)