Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix ai-native-module.md #145

Merged
merged 1 commit into from
Jul 15, 2024
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
12 changes: 6 additions & 6 deletions docs/integrate/module-usage/ai-native-module.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ startServer({

The purpose of this step is to register various AI capabilities.

1. Create a new contribution file and implement the AiNativeCoreContribution interface.
1. Create a new contribution file and implement the AINativeCoreContribution interface.

```typescript
import { AiNativeCoreContribution } from '@opensumi/ide-ai-native/lib/browser/types';
import { AINativeCoreContribution } from '@opensumi/ide-ai-native/lib/browser/types';

@Domain(AiNativeCoreContribution)
export class AiNativeContribution implements AiNativeCoreContribution {
@Domain(AINativeCoreContribution)
export class AiNativeContribution implements AINativeCoreContribution {
// Register various AI capabilities here
}
```
Expand Down Expand Up @@ -110,8 +110,8 @@ So, it is necessary to provide various provider capabilities in AiNativeContribu
Taking inline chat as an example, implement the registerInlineChatFeature method in AiNativeContribution.

```typescript
@Domain(AiNativeCoreContribution)
export class AiNativeContribution implements AiNativeCoreContribution {
@Domain(AINativeCoreContribution)
export class AiNativeContribution implements AINativeCoreContribution {
// Obtain the registered backend service through AIBackSerivcePath
// At this point, you can directly RPC call the functions provided by the backend service
@Autowired(AIBackSerivcePath)
Expand Down
12 changes: 6 additions & 6 deletions docs/integrate/module-usage/ai-native-module.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ startServer({

这一步的目的是为了注册各种 AI 能力

**1. 新建一个 `contribution` 文件,并实现 `AiNativeCoreContribution` 接口**
**1. 新建一个 `contribution` 文件,并实现 `AINativeCoreContribution` 接口**

```typescript
import { AiNativeCoreContribution } from '@opensumi/ide-ai-native/lib/browser/types';
import { AINativeCoreContribution } from '@opensumi/ide-ai-native/lib/browser/types';

@Domain(AiNativeCoreContribution)
export class AiNativeContribution implements AiNativeCoreContribution {
@Domain(AINativeCoreContribution)
export class AiNativeContribution implements AINativeCoreContribution {
// 在这里注册各种 AI 能力
}
```
Expand Down Expand Up @@ -140,8 +140,8 @@ const serverApp = new ServerApp(opts);
我们以 inline chat 为例,在 AiNativeContribution 中实现 `registerInlineChatFeature` 方法

```typescript
@Domain(AiNativeCoreContribution)
export class AiNativeContribution implements AiNativeCoreContribution {
@Domain(AINativeCoreContribution)
export class AiNativeContribution implements AINativeCoreContribution {
// 通过 AIBackSerivcePath 拿到注册好的后端服务
// 此时就能直接 RPC 调用后端服务提供的函数
@Autowired(AIBackSerivcePath)
Expand Down
Loading