Update API and AI, user management related content

This commit is contained in:
swve
2024-02-11 19:09:25 +01:00
parent c8dd17c348
commit 3a8b2f0d46
15 changed files with 154 additions and 20 deletions

View File

@@ -1,4 +1,3 @@
{
"infra-overview": "Infrastructure Overview",
"api-overview": "API Overview"
"infra-overview": "Infrastructure Overview"
}

View File

@@ -1,7 +0,0 @@
import { Callout } from 'nextra-theme-docs'
# API Overview
<Callout type="info" >
This page is still a work in progress.
</Callout>

View File

@@ -5,9 +5,9 @@ import Image from "next/image";
LearnHouse is separated into two parts/codebases :
- **Frontend** : Web interface for the user to interact with the application, some parts are server rendered and some are client rendered, we use React Server Components enabled by Next.js 13
- **Frontend** : Web interface for the user to interact with the application, some parts are server rendered and some are client rendered, we use React Server Components enabled by Next.js 14
- **Backend** : Backend code in Python using FastAPI that handles : Storage, Authentication, Uploads etc.
- **Backend** : Backend code in Python using FastAPI that handles : Storage, Authentication, Uploads, AI etc.
Here is a diagram that explains the infrastructure in a simple way to get started :

View File

@@ -2,5 +2,7 @@
"courses": "Courses",
"activities": "Activities",
"collections": "Collections",
"ai": "LearnHouse AI",
"users-management": "Users Management",
"trail": "Trail"
}

View File

@@ -0,0 +1,4 @@
{
"students": "Students",
"teachers": "Teachers"
}

View File

@@ -0,0 +1,13 @@
# For students
LearnHouse AI provides different features for students to help them in their learning process.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/ai/screen-ai-1.png" alt="Hello" width={800} height={1300} />
- Chat with activity : Students can chat with the bot and ask questions about the course. The bot will answer the questions and provide the students with the necessary information.
## Context aware
LearnHouse AI is context aware. It can understand the context of the course and the activity and replies accordingly.

View File

@@ -0,0 +1,16 @@
# For teachers
LearnHouse AI provides different features to improve teachers workflow while teaching online & writing content.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/ai/screen-ai-4.png" alt="Hello" width={800} height={1300} />
- Writer : Write content with AI assistance.
- Continue writing : Based on a paragraph or a sentence, AI can continue writing the content.
- Make longer : AI can make the content longer bsed on the text selected.
- Translate : Translate the content to different languages.
## Context aware
LearnHouse AI is context aware. It can understand the context of the content and provide suggestions based on the context of your course and previous paragraphs.

View File

@@ -0,0 +1,14 @@
import Image from 'next/image'
# Users management
You can manage users from the admin dashboard. You can add, remove, and edit users. You can also assign roles to users.
<br/>
<img style={{borderRadius:10}} quality={100} src="https://www.learnhouse.app/product/screen-4.png" alt="Hello" width={800} height={500} />
- Users : Add new users, remove users, and edit their roles and permissions.
- Invite users : Invite new users to join your organization by sending them an email and assigning them to a UserGroup.
- Signup Acess : Enable or disable the signup access for new users, if disabled only userd with an invite code can join the organization.

View File

@@ -3,6 +3,6 @@
"configuration": "Configuration",
"organization-hosting-modes": "Organization Hosting Modes",
"docker-and-kube": "Docker and Kubernetes",
"vercel": "Vercel",
"ai": "AI",
"content-storage": "Content Storage"
}

87
pages/self-hosting/ai.mdx Normal file
View File

@@ -0,0 +1,87 @@
import { Callout } from 'nextra/components'
# AI Self Hosting
AI can be used in your self hosted instance of LearnHouse, it is powered by [OpenAI](https://openai.com) and you will need to create an account and get an API key to use it.
To enable AI in your self hosted instance, you will need to follow the steps below.
## Enabling AI
Either use environment variables or the config file to enable AI.
### Environment Variables
- `LEARNHOUSE_OPENAI_API_KEY` - Your OpenAI API key
- `LEARNHOUSE_IS_AI_ENABLED` - Set to `true` to enable AI, `false` to disable it
### Config file
```json filename="config.yaml" copy {18-20}
site_name: LearnHouse
site_description: LearnHouse is an open-source platform tailored for learning experiences.
contact_email: hi@learnhouse.app
hosting_config:
domain: learnhouse.app
ssl: true
allowed_origins:
- http://localhost:3000
- http://localhost:3001
cookies_config:
domain: ".localhost"
allowed_regexp: '\b((?:https?://)[^\s/$.?#].[^\s]*)\b'
database_config:
sql_connection_string: postgresql://learnhouse:learnhouse@postgresql:27017/
ai_config:
openai_api_key: "your-openai-api-key"
is_ai_enabled: true
```
## Organizations
AI is enabled on a per-organization basis, you can enable or disable AI for each organization, choose what model and features to use and set the usage limit.
<Callout type="info">
The Organization config model is subject to change in future versions of LearnHouse
</Callout>
### Organization Config table
Every Organization comes with a dedicated row in the `organizationconfig` table, you can find the `config` json column and set the AI configuration for that organization.
```json filename="organizationconfig > your organization row > config column" copy {2-15}
{
"AIConfig": {
"ai_model": "gpt-3.5-turbo",
"embeddings": "text-embedding-ada-002",
"enabled": true,
"features": {
"activity_ask": true,
"course_ask": false,
"editor": true,
"global_ai_ask": false
},
"limits": {
"limits_enabled": true,
"max_asks": 200
}
},
"GeneralConfig": {
"active": true,
"color": "#000000",
"limits": {
"limits_enabled": false,
"max_staff": 0,
"max_storage": 0,
"max_users": 0
},
"users": {
"signup_mechanism": "inviteOnly"
}
}
}
```

View File

@@ -1,5 +1,18 @@
# Self Hosting Overview
LearnHouse is open source software and can be installed and maintained on just about any Cloud provider. We also support different hosting schemas like using AWS S3 or CloudFlare R2 for content storage or using Vercel for frontend hosting.
LearnHouse is open source software and can be installed and maintained on just about any Cloud provider. We also support different hosting schemas like using AWS S3 or CloudFlare R2 for content storage.
## Prerequisites
- Node.js 18.x
- Python 3.11
- Pnpm
- Docker
- Docker Compose
## Steps
- [Get started & Install LearnHouse](/setup-dev-environment)
- [Configure LearnHouse](/self-hosting/configuration)

View File

@@ -1,7 +0,0 @@
import { Callout } from "nextra-theme-docs";
# Vercel as Frontend
<Callout type="info" >
We're still working on a Vercel guide.
</Callout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 KiB

After

Width:  |  Height:  |  Size: 672 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 KiB