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:
include:
- test_service: "appflowy_cloud"
test_cmd: "--workspace --exclude appflowy-history"
test_cmd: "--workspace --exclude appflowy-history appflowy-ai-client"
- test_service: "appflowy_history"
test_cmd: "-p appflowy-history"
steps:

View File

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

View File

@ -135,7 +135,7 @@ services:
- 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}
appflowy_ai:
ai:
restart: on-failure
image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest}
ports:

View File

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

View File

@ -130,7 +130,7 @@ services:
- 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}
appflowy_ai:
ai:
restart: on-failure
image: appflowyinc/appflowy_ai:${APPFLOWY_AI_VERSION:-latest}
ports:

View File

@ -1,9 +1,9 @@
use appflowy_ai_client::client::AppFlowyAIClient;
use crate::appflowy_ai_client;
use appflowy_ai_client::dto::CompletionType;
#[tokio::test]
async fn continue_writing_test() {
let client = AppFlowyAIClient::new("http://localhost:5001");
let client = appflowy_ai_client();
let resp = client
.completion_text("I feel hungry", CompletionType::ContinueWriting)
.await
@ -14,7 +14,7 @@ async fn continue_writing_test() {
#[tokio::test]
async fn improve_writing_test() {
let client = AppFlowyAIClient::new("http://localhost:5001");
let client = appflowy_ai_client();
let resp = client
.completion_text(
"I fell tired because i sleep not very well last night",
@ -29,8 +29,7 @@ async fn improve_writing_test() {
}
#[tokio::test]
async fn make_text_shorter_text() {
let client = AppFlowyAIClient::new("http://localhost:5001");
let client = appflowy_ai_client();
let resp = client
.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",

View File

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

View File

@ -1,4 +1,10 @@
use appflowy_ai_client::client::AppFlowyAIClient;
mod chat_test;
mod row_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;
#[tokio::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 result = client

View File

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