Skip to content

Commit c42eb6d

Browse files
committed
feat(docs): update AI configurations and usage guide
Update the AI configurations and usage guide in the documentation. The changes cover revising the configuration titles for clarity, modifying the steps for 'Xunfei Xinghuo' setup, restructuring the 'Custom Config' section to include a compatible option with 'OpenAI', and adding formatting examples for 'Request' and 'Response' logic. Additionally, the features section received updates for the 'AutoCRUD mode' and the addition of a link to a custom action guide. This commit aligns with the Conventional Commits specification, using 'feat' for features and 'docs' for documentation updates.
1 parent 8e6affb commit c42eb6d

File tree

1 file changed

+10
-71
lines changed

1 file changed

+10
-71
lines changed

docs/usage.md

Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permalink: /quick-start
1212

1313
## Config
1414

15-
### Official OpenAI config
15+
### OpenAI Official config
1616

1717
1. open AutoDev Config in `Settings` -> `Tools` -> `AutoDev`.
1818
2. select `AI Engine` -> `OpenAI`, select `Open AI Model` -> `gpt-3.5-turbo`
@@ -27,14 +27,21 @@ permalink: /quick-start
2727
4. fill `OpenAI API Key` with your Host OpenAI API Key.
2828
5. Apply and OK.
2929

30-
### Azure Config
30+
### OpenAI Azure Config
3131

3232
1. open AutoDev Config in `Settings` -> `Tools` -> `AutoDev`.
3333
2. select `AI Engine` -> `Azure`, select `Open AI Model` -> `gpt-3.5-turbo`
3434
3. fill `Custom OpenAI Host` with your OpenAI API Endpoint. (with Key in URL)
3535
4. Apply and OK.
3636

37-
### Custom Config
37+
### Xunfei Xinghuo
38+
39+
1. open AutoDev Config in `Settings` -> `Tools` -> `AutoDev`.
40+
2. select `AI Engine` -> `Xinghuo`
41+
3. fill `AppId`, `AppKey`, `AppSecret` with your Xunfei Xinghuo API Key.
42+
4. Apply and OK.
43+
44+
### Custom Config / OpenAI compatible
3845

3946
1. open AutoDev Config in `Settings` -> `Tools` -> `AutoDev`.
4047
2. select `AI Engine` -> `Custom`
@@ -44,71 +51,3 @@ permalink: /quick-start
4451
6. Apply and OK.
4552

4653
for more, see in [Customize LLM Server](/custom/llm-server)
47-
48-
the request format logic:
49-
50-
```kotlin
51-
/**
52-
* request format:
53-
* {
54-
* "messages": [
55-
* { "role": "user", "message": "I'm Nihillum." },
56-
* { "role": "assistant", "message": "OK" },
57-
* { "role": "user", "message": "What did I just say?" }
58-
* ]
59-
*}
60-
*/
61-
@Serializable
62-
data class Message(val role: String, val message: String)
63-
val messages += Message("user", promptText)
64-
val requestContent = Json.encodeToString<List<Message>>(messages)
65-
```
66-
67-
The response format logic:
68-
69-
```kotlin
70-
if (engineFormat.isNotEmpty()) {
71-
val chunk: String = JsonPath.parse(sse!!.data)?.read(engineFormat)
72-
?: throw Exception("Failed to parse chunk")
73-
trySend(chunk)
74-
} else {
75-
val result: ChatCompletionResult =
76-
ObjectMapper().readValue(sse!!.data, ChatCompletionResult::class.java)
77-
78-
val completion = result.choices[0].message
79-
if (completion != null && completion.content != null) {
80-
trySend(completion.content)
81-
}
82-
}
83-
```
84-
85-
## Features
86-
87-
### CodeCompletion mode
88-
89-
You can:
90-
91-
- Right-click on the code editor, select `AutoDev` -> `CodeCompletion` -> `CodeComplete`
92-
- or use `Alt + Enter` to open `Intention Actions` menu, select `AutoDev` -> `CodeCompletion`
93-
94-
![Code completion](https://unitmesh.cc/auto-dev/completion-mode.png)
95-
96-
### Custom Action
97-
98-
![Code completion](https://unitmesh.cc/auto-dev/custom-action.png)
99-
100-
For more, see [Custom Action](docs/custom-action.md)
101-
102-
### AutoCRUD mode (Only support Java/Kotlin project)
103-
104-
1. add `// devti://story/github/1` comments in your code.
105-
2. configure GitHub repository for Run Configuration.
106-
3. click `AutoDev` button in the comments' left.
107-
108-
Run Screenshots:
109-
110-
![AutoDev](https://unitmesh.cc/auto-dev/init-instruction.png)
111-
112-
Output Screenshots:
113-
114-
![AutoDev](https://unitmesh.cc/auto-dev/blog-controller.png)

0 commit comments

Comments
 (0)