Fixed import for book flight ai agent (#844)
* Fixed: The import path error caused by moving the directory of the flight booking AI-Agent.
Fix import and remove `config.example.yml` file.
* Add the debug binary file `__debug_bin` to .gitignore.
diff --git a/.gitignore b/.gitignore
index 518575a..83fb958 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
*.so
*.dylib
*.DS_Store
+*__debug_bin*
dist/
*.log
diff --git a/book-flight-ai-agent/README.md b/book-flight-ai-agent/README.md
index 051917e..5f83699 100644
--- a/book-flight-ai-agent/README.md
+++ b/book-flight-ai-agent/README.md
@@ -29,10 +29,10 @@
### 3. Run the example
-First, enter the `llm/book-flight` directory.
+First, enter the `book-flight-ai-agent` directory.
```shell
-$ cd llm/book-flight
+$ cd book-flight-ai-agent
```
#### Server operation
diff --git a/book-flight-ai-agent/README_zh.md b/book-flight-ai-agent/README_zh.md
index 04622e2..b9c52c1 100644
--- a/book-flight-ai-agent/README_zh.md
+++ b/book-flight-ai-agent/README_zh.md
@@ -29,10 +29,10 @@
### 3. 运行示例
-首先,进入 `llm/book-flight` 目录.
+首先,进入 `book-flight-ai-agent` 目录.
```shell
-$ cd llm/book-flight
+$ cd book-flight-ai-agent
```
#### 服务端运行
diff --git a/book-flight-ai-agent/go-client/cmd/client.go b/book-flight-ai-agent/go-client/cmd/client.go
index a7c4b55..ea6a84c 100644
--- a/book-flight-ai-agent/go-client/cmd/client.go
+++ b/book-flight-ai-agent/go-client/cmd/client.go
@@ -31,8 +31,8 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/conf"
- chat "github.com/apache/dubbo-go-samples/llm/book-flight/proto"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/conf"
+ chat "github.com/apache/dubbo-go-samples/book-flight-ai-agent/proto"
)
var cfgEnv = conf.GetEnvironment()
diff --git a/book-flight-ai-agent/go-client/frontend/handlers/chat.go b/book-flight-ai-agent/go-client/frontend/handlers/chat.go
index 9efab28..46ea5d8 100644
--- a/book-flight-ai-agent/go-client/frontend/handlers/chat.go
+++ b/book-flight-ai-agent/go-client/frontend/handlers/chat.go
@@ -33,9 +33,9 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-client/frontend/service"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/conf"
- chat "github.com/apache/dubbo-go-samples/llm/book-flight/proto"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-client/frontend/service"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/conf"
+ chat "github.com/apache/dubbo-go-samples/book-flight-ai-agent/proto"
)
type ChatHandler struct {
diff --git a/book-flight-ai-agent/go-client/frontend/main.go b/book-flight-ai-agent/go-client/frontend/main.go
index a60f471..805da5d 100644
--- a/book-flight-ai-agent/go-client/frontend/main.go
+++ b/book-flight-ai-agent/go-client/frontend/main.go
@@ -31,10 +31,10 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-client/frontend/handlers"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-client/frontend/service"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/conf"
- chat "github.com/apache/dubbo-go-samples/llm/book-flight/proto"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-client/frontend/handlers"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-client/frontend/service"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/conf"
+ chat "github.com/apache/dubbo-go-samples/book-flight-ai-agent/proto"
)
var cfgEnv = conf.GetEnvironment()
diff --git a/book-flight-ai-agent/go-client/frontend/service/context.go b/book-flight-ai-agent/go-client/frontend/service/context.go
index e15d655..58fdd9d 100644
--- a/book-flight-ai-agent/go-client/frontend/service/context.go
+++ b/book-flight-ai-agent/go-client/frontend/service/context.go
@@ -23,7 +23,7 @@
)
import (
- chat "github.com/apache/dubbo-go-samples/llm/book-flight/proto"
+ chat "github.com/apache/dubbo-go-samples/book-flight-ai-agent/proto"
)
type ContextManager struct {
diff --git a/book-flight-ai-agent/go-server/actions/action.go b/book-flight-ai-agent/go-server/actions/action.go
index 0823b8f..b886664 100644
--- a/book-flight-ai-agent/go-server/actions/action.go
+++ b/book-flight-ai-agent/go-server/actions/action.go
@@ -23,7 +23,7 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/mcp"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/mcp"
)
type Action mcp.RequestRPC
diff --git a/book-flight-ai-agent/go-server/agents/agent.go b/book-flight-ai-agent/go-server/agents/agent.go
index df60c01..8bac126 100644
--- a/book-flight-ai-agent/go-server/agents/agent.go
+++ b/book-flight-ai-agent/go-server/agents/agent.go
@@ -23,7 +23,7 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/tools"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/tools"
)
// Agent is the interface all agents must implement.
diff --git a/book-flight-ai-agent/go-server/agents/cot_agent.go b/book-flight-ai-agent/go-server/agents/cot_agent.go
index 8844df7..08c25ad 100644
--- a/book-flight-ai-agent/go-server/agents/cot_agent.go
+++ b/book-flight-ai-agent/go-server/agents/cot_agent.go
@@ -26,12 +26,12 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/actions"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/conf"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/model"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/model/ollama"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/prompts"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/tools"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/actions"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/conf"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/model"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/model/ollama"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/prompts"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/tools"
)
type CotAgentRunner struct {
diff --git a/book-flight-ai-agent/go-server/agents/task.go b/book-flight-ai-agent/go-server/agents/task.go
index 4dd2b7f..dc40809 100644
--- a/book-flight-ai-agent/go-server/agents/task.go
+++ b/book-flight-ai-agent/go-server/agents/task.go
@@ -23,7 +23,7 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/tools"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/tools"
)
type TaskState int
diff --git a/book-flight-ai-agent/go-server/cmd/server.go b/book-flight-ai-agent/go-server/cmd/server.go
index 5744e49..7cca7dd 100644
--- a/book-flight-ai-agent/go-server/cmd/server.go
+++ b/book-flight-ai-agent/go-server/cmd/server.go
@@ -32,12 +32,12 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/agents"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/conf"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/model/ollama"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/tools"
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/tools/bookingflight"
- chat "github.com/apache/dubbo-go-samples/llm/book-flight/proto"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/agents"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/conf"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/model/ollama"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/tools"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/tools/bookingflight"
+ chat "github.com/apache/dubbo-go-samples/book-flight-ai-agent/proto"
)
var cfgEnv = conf.GetEnvironment()
diff --git a/book-flight-ai-agent/go-server/conf/config.example.yml b/book-flight-ai-agent/go-server/conf/config.example.yml
deleted file mode 100644
index db6e98d..0000000
--- a/book-flight-ai-agent/go-server/conf/config.example.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-LLM: {
- url: "http://localhost:11434",
- model: "deepseek-r1:1.5b"
-}
\ No newline at end of file
diff --git a/book-flight-ai-agent/go-server/conf/config.go b/book-flight-ai-agent/go-server/conf/config.go
index 1cc58bc..e98381b 100644
--- a/book-flight-ai-agent/go-server/conf/config.go
+++ b/book-flight-ai-agent/go-server/conf/config.go
@@ -23,7 +23,9 @@
"os"
"strconv"
"sync"
+)
+import (
"github.com/joho/godotenv"
"gopkg.in/yaml.v3"
)
diff --git a/book-flight-ai-agent/go-server/model/ollama/ollama.go b/book-flight-ai-agent/go-server/model/ollama/ollama.go
index 72cb94b..b583a32 100644
--- a/book-flight-ai-agent/go-server/model/ollama/ollama.go
+++ b/book-flight-ai-agent/go-server/model/ollama/ollama.go
@@ -29,7 +29,7 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/model"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/model"
)
type (
diff --git a/book-flight-ai-agent/go-server/model/ollama/options.go b/book-flight-ai-agent/go-server/model/ollama/options.go
index 03eee75..8dc28a9 100644
--- a/book-flight-ai-agent/go-server/model/ollama/options.go
+++ b/book-flight-ai-agent/go-server/model/ollama/options.go
@@ -17,7 +17,7 @@
package ollama
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/model"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/model"
)
func WithStreamingFunc(fn model.CallFunc) model.Option {
diff --git a/book-flight-ai-agent/go-server/tools/bookingflight/booking_tools.go b/book-flight-ai-agent/go-server/tools/bookingflight/booking_tools.go
index 6970d07..a26f85e 100644
--- a/book-flight-ai-agent/go-server/tools/bookingflight/booking_tools.go
+++ b/book-flight-ai-agent/go-server/tools/bookingflight/booking_tools.go
@@ -24,7 +24,7 @@
)
import (
- "github.com/apache/dubbo-go-samples/llm/book-flight/go-server/tools"
+ "github.com/apache/dubbo-go-samples/book-flight-ai-agent/go-server/tools"
)
var (
diff --git a/book-flight-ai-agent/proto/chat.proto b/book-flight-ai-agent/proto/chat.proto
index 0cdd91d..fe61ded 100644
--- a/book-flight-ai-agent/proto/chat.proto
+++ b/book-flight-ai-agent/proto/chat.proto
@@ -19,7 +19,7 @@
package chat;
-option go_package = "github.com/apache/dubbo-go-samples/llm/book-flight/proto;chat";
+option go_package = "github.com/apache/dubbo-go-samples/book-flight-ai-agent/proto;chat";
message ChatRequest {
repeated ChatMessage messages = 1;