Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions contrib/copilot-plugin/src/app/ChatBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ export default function ChatBox() {
});
if (!response.ok) throw new Error("Remote server error");
const data = await response.json();
useChatStore.getState().addChat({
role: "assistant",
message: data?.data?.answer ?? "No answer found",
timestamp: new Date(),
messageInfo: data?.data?.message_info, // Store the message_info from response
});
if (data?.data?.answer !== "skip") {
useChatStore.getState().addChat({
role: "assistant",
message: data?.data?.answer ?? "No answer found",
timestamp: new Date(),
messageInfo: data?.data?.message_info, // Store the message_info from response
});
}
} catch (err) {
toast.error("Failed to get response from remote server");
}
Expand Down
3 changes: 2 additions & 1 deletion src/copilot-chat/config/copilot-chat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ openai-api-key: "<your-openai-key>"
llm-provider: "azure"
llm-endpoint: "https://endpoint.openai.com"
llm-model: "gpt-4o"
llm-version: "2025-01-01-preview"
llm-version: "2025-01-01-preview"
valid-groups: "admin,superuser"
4 changes: 4 additions & 0 deletions src/copilot-chat/deploy/copilot-chat-deployment.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ spec:
value: {{ cluster_cfg["copilot-chat"]["llm-version"] }}
- name: AGENT_HOST
value: {{ cluster_cfg["copilot-chat"]["agent-host"] }}
- name: RESTSERVER_URL
value: {{ cluster_cfg["copilot-chat"]["rest-server"]["url"] }}
- name: COPILOT_VALID_GROUPS
value: {{ cluster_cfg["copilot-chat"]["valid-groups"] }}
ports:
- containerPort: {{ cluster_cfg["copilot-chat"]["agent-port"] | default("50000") }}
hostPort: {{ cluster_cfg["copilot-chat"]["agent-port"] | default("50000") }}
Expand Down
21 changes: 6 additions & 15 deletions src/copilot-chat/src/copilot_agent/__main__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
"""Main module."""

import argparse # noqa: E402

from .copilot import CoPilot # noqa: E402


def parse_args():
"""Parse command line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument('--user', type=str, help='user question, query or inquery', default=None)
args = parser.parse_args()
return args
from .copilot_service import CoPilotService
from .copilot_conversation import CoPilotConversation


def main():
"""Main function."""
args = parse_args()
apiserver = CoPilot(args)
apiserver.run()
copilot_conversation = CoPilotConversation()
api = CoPilotService(copilot_conversation)
api.run()


if __name__ == '__main__':
if __name__ == "__main__":
"""Entry point."""
main()
258 changes: 0 additions & 258 deletions src/copilot-chat/src/copilot_agent/copilot.py

This file was deleted.

Loading