chore: fix ci (#549)

* chore: fix ci
This commit is contained in:
Nathan.fooo 2024-05-12 21:02:28 +08:00 committed by GitHub
parent d994b10115
commit c491f1a560
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 22 additions and 16 deletions

View File

@ -63,7 +63,7 @@ jobs:
matrix: matrix:
include: include:
- test_service: "appflowy_cloud" - test_service: "appflowy_cloud"
test_cmd: "--workspace --exclude appflowy-history" test_cmd: "--workspace --exclude appflowy-history appflowy-ai-client"
- test_service: "appflowy_history" - test_service: "appflowy_history"
test_cmd: "-p appflowy-history" test_cmd: "-p appflowy-history"
steps: steps:

View File

@ -108,7 +108,7 @@ CLOUDFLARE_TUNNEL_TOKEN=
# AppFlowy AI # AppFlowy AI
APPFLOWY_AI_OPENAI_API_KEY= APPFLOWY_AI_OPENAI_API_KEY=
APPFLOWY_AI_SERVER_HOST=appflowy_ai APPFLOWY_AI_SERVER_HOST=ai
APPFLOWY_AI_SERVER_PORT=5001 APPFLOWY_AI_SERVER_PORT=5001
# AppFlowy History # AppFlowy History

View File

@ -135,7 +135,7 @@ services:
- ADMIN_FRONTEND_GOTRUE_URL=${ADMIN_FRONTEND_GOTRUE_URL:-http://gotrue:9999} - ADMIN_FRONTEND_GOTRUE_URL=${ADMIN_FRONTEND_GOTRUE_URL:-http://gotrue:9999}
- ADMIN_FRONTEND_APPFLOWY_CLOUD_URL=${ADMIN_FRONTEND_APPFLOWY_CLOUD_URL:-http://appflowy_cloud:8000} - ADMIN_FRONTEND_APPFLOWY_CLOUD_URL=${ADMIN_FRONTEND_APPFLOWY_CLOUD_URL:-http://appflowy_cloud:8000}
appflowy_ai: ai:
restart: on-failure restart: on-failure
image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest} image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest}
ports: ports:

View File

@ -101,7 +101,7 @@ services:
volumes: volumes:
- ./docker/pgadmin/servers.json:/pgadmin4/servers.json - ./docker/pgadmin/servers.json:/pgadmin4/servers.json
appflowy_ai: ai:
restart: on-failure restart: on-failure
image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest} image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest}
ports: ports:

View File

@ -130,7 +130,7 @@ services:
- ADMIN_FRONTEND_GOTRUE_URL=${ADMIN_FRONTEND_GOTRUE_URL:-http://gotrue:9999} - ADMIN_FRONTEND_GOTRUE_URL=${ADMIN_FRONTEND_GOTRUE_URL:-http://gotrue:9999}
- ADMIN_FRONTEND_APPFLOWY_CLOUD_URL=${ADMIN_FRONTEND_APPFLOWY_CLOUD_URL:-http://appflowy_cloud:8000} - ADMIN_FRONTEND_APPFLOWY_CLOUD_URL=${ADMIN_FRONTEND_APPFLOWY_CLOUD_URL:-http://appflowy_cloud:8000}
appflowy_ai: ai:
restart: on-failure restart: on-failure
image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest} image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest}
ports: ports:

View File

@ -1,9 +1,9 @@
use appflowy_ai_client::client::AppFlowyAIClient; use crate::appflowy_ai_client;
use appflowy_ai_client::dto::CompletionType; use appflowy_ai_client::dto::CompletionType;
#[tokio::test] #[tokio::test]
async fn continue_writing_test() { async fn continue_writing_test() {
let client = AppFlowyAIClient::new("http://localhost:5001"); let client = appflowy_ai_client();
let resp = client let resp = client
.completion_text("I feel hungry", CompletionType::ContinueWriting) .completion_text("I feel hungry", CompletionType::ContinueWriting)
.await .await
@ -14,7 +14,7 @@ async fn continue_writing_test() {
#[tokio::test] #[tokio::test]
async fn improve_writing_test() { async fn improve_writing_test() {
let client = AppFlowyAIClient::new("http://localhost:5001"); let client = appflowy_ai_client();
let resp = client let resp = client
.completion_text( .completion_text(
"I fell tired because i sleep not very well last night", "I fell tired because i sleep not very well last night",
@ -29,8 +29,7 @@ async fn improve_writing_test() {
} }
#[tokio::test] #[tokio::test]
async fn make_text_shorter_text() { async fn make_text_shorter_text() {
let client = AppFlowyAIClient::new("http://localhost:5001"); let client = appflowy_ai_client();
let resp = client let resp = client
.completion_text( .completion_text(
"I have an immense passion and deep-seated affection for Rust, a modern, multi-paradigm, high-performance programming language that I find incredibly satisfying to use due to its focus on safety, speed, and concurrency", "I have an immense passion and deep-seated affection for Rust, a modern, multi-paradigm, high-performance programming language that I find incredibly satisfying to use due to its focus on safety, speed, and concurrency",

View File

@ -3,7 +3,7 @@ use appflowy_ai_client::dto::{CollabType, Document, SearchDocumentsRequest};
#[tokio::test] #[tokio::test]
async fn index_search() { async fn index_search() {
let client = AppFlowyAIClient::new("http://localhost:5001"); let client = appflowy_ai_client();
client client
.index_documents(&[ .index_documents(&[

View File

@ -1,4 +1,10 @@
use appflowy_ai_client::client::AppFlowyAIClient;
mod chat_test; mod chat_test;
mod row_test; mod row_test;
// mod index_test; // mod index_test;
pub fn appflowy_ai_client() -> AppFlowyAIClient {
AppFlowyAIClient::new("http://localhost:5001")
}

View File

@ -1,9 +1,10 @@
use appflowy_ai_client::client::AppFlowyAIClient; use crate::appflowy_ai_client;
use serde_json::json; use serde_json::json;
#[tokio::test] #[tokio::test]
async fn summarize_row_test() { async fn summarize_row_test() {
let client = AppFlowyAIClient::new("http://localhost:5001"); let client = appflowy_ai_client();
let json = json!({"name": "Jack", "age": 25, "city": "New York"}); let json = json!({"name": "Jack", "age": 25, "city": "New York"});
let result = client let result = client

View File

@ -93,9 +93,9 @@ http {
} }
# AppFlowy AI # AppFlowy AI
location /appflowy_ai/ { location /ai {
proxy_pass http://appflowy_ai:5001; proxy_pass http://ai:5001;
proxy_set_header Host $http_host; proxy_set_header Host $host;
proxy_pass_request_headers on; proxy_pass_request_headers on;
} }