parent
d994b10115
commit
c491f1a560
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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(&[
|
||||||
|
|
|
||||||
|
|
@ -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")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue