Skip to content

Commit

Permalink
docs: fix ai-native-module.md (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
godkun authored Jul 15, 2024
1 parent 3353e7f commit 584b1cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
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

0 comments on commit 584b1cc

Please sign in to comment.