Giter Site home page Giter Site logo

unit-mesh / auto-dev Goto Github PK

View Code? Open in Web Editor NEW
2.5K 42.0 295.0 8.77 MB

🧙‍AutoDev: The AI-powered coding wizard with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic Auto Dev/Testing/Document/Agent feature 🧪 included! 🚀

Home Page: https://ide.unitmesh.cc/

License: Mozilla Public License 2.0

Kotlin 98.47% Java 0.02% HTML 0.07% Python 0.97% TypeScript 0.01% Lex 0.46%
ide intellij aigc genai genaistack

auto-dev's Introduction

logo

AutoDev for Intellij

Build Powered By

🧙‍AutoDev: The AI-powered coding wizard with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant 🐞! Customizable prompts 🎨 and a magic Auto Dev/Testing/Document/Agent feature 🧪 included! 🚀

VSCode Version: https://github.com/unit-mesh/auto-dev-vscode

Quick Start →

DevIns — AI Agent language for AutoDevelopment → which you can use follow syntax as bridges for Human-AI-IDE:

/write:src/main/java/cc/unitmesh/Controller.java#L1-L12

```java
public class Controller {
    public void method() {
        System.out.println("Hello, World!");
    }
}
```

With built-in syntax highlighting and auto-completion, you can use DevIns as next-generation AI Agent language.

AutoDev Architecture

Here is the AutoDev architecture:

AutoDev Feature Overview

Overview

Features:

  • Languages support: Java, Kotlin, JavaScript/TypeScript, Rust, Python, Golang, C/C++/OC, or others...
  • Auto development mode
    • AutoCRUD (Spring framework). With DevTi Protocol (like devti://story/github/1102) will auto generate Model-Controller-Service-Repository code.
    • AutoSQL (required Database plugin). Context-aware SQL generation.
    • AutoPage (React). Context-aware Web Page generation.
    • AutoArkUI (HarmonyOS). Auto generate HarmonyOS ArkUI code.
    • AutoTesting. create unit test intention, auto run unit test and try to fix test.
    • AutoDocument. Auto generate document.
  • Copilot mode
    • AutoDev will help you find bug, explain code, trace exception, generate commits, and more.
    • Pattern specific. Based on your code context like (Controller, Service import), AutoDev will suggest the best code to you.
    • Related code. Based on recent file changes, AutoDev will call calculate similar chunk to generate the best code.
  • Chat with AI. Chat with selection code and context-aware code.
  • Customize.
    • Custom specification of prompt. For example, Controller, Service, Repository, Model, etc.
    • Custom intention action. You can add your own intention action.
    • Custom LLM Server. You can customize your LLM Server in Settings -> Tools -> AutoDev
    • Custom Living documentation. Customize your own living documentation, like annotation.
    • Team AI. Customize your team prompts in codebase, and distribute to your team.
    • Prompt override. You can override AutoDev's prompt in your codebase.
  • SDLC
    • VCS. Generate/improve commit message, release note, and more.
    • Code Review. Generate code-review content.
    • Smart Refactoring. AI based Rename, refactoring with code smell, refactoring suggetion and more.
    • Dockerfile. Based on your project, generate Dockerfile.
    • CI/CD config. Based on build tool, generate CI/CD config file, like .github/workflows/build.yml.
    • Terminal. In Terminal ToolWindow, you can use custom input to generate shell/command
  • Custom AI Agent
    • Executable AI Agent language: DevIns.
    • Custom AI Agent. You can integrate your own AI Agent into AutoDev.
  • Model
    • Built-in LLM Fine-tune
    • UnitEval evaluate llm result
    • UnitGen generate code-llm fine-tune data.

AutoDev fine-tune models:

download from HuggingFace

name model download (HuggingFace) model download (OpenBayes)
DeepSeek 6.7B AutoDev Coder AutoDev Coder](https://openbayes.com/console/phodal/models/rCmer1KQSgp/9/overview)

Language Features

Language Support

We follow Chapi AST analysis engine for language support tier.

Features Java Python Go Kotlin JS/TS C/C++ C# Scala Rust ArkTS
Chat Language Context
Structure AST
Doc Generation
Precision Test Generation
Precision Code Generation
AutoCRUD

Extensions

see in exts

Demo

DevIns Language demo (Bilibili) - 中文

Watch the video

Video demo (YouTube) — English

Watch the video

Video demo (Bilibili) - 中文

Watch the video

Useful Links

Who is using AutoDev?

Welcome to add your company here.

  • Thoughtworks, a leading technology consultancy.

License

Regarding the matter discussed in the LICENSE issue at the project's outset, we want to address the complexity of JetBrain plugin development. In the process, we referenced certain code and API designs from the JetBrains Community version and the JetBrains AI Assistant plugin. JetBrains understandably reserves the right to view this as potential infringement on their intellectual property.

Therefore, as of April 2024, AutoDev is no longer available on the JetBrains Plugin Marketplace. However, for older versions' AutoDev, you can access downloads from our Releases page.

Additionally, we extend a warm invitation to participate in the development of the VSCode version. Your contributions are greatly appreciated.

Known License issues: JetBrain plugin development is no walk in the park! Oops, we cheekily borrowed some code from the JetBrains Community version and the super cool JetBrains AI Assistant plugin in our codebase. But fret not, we are working our magic to clean it up diligently! 🧙‍♂️✨.

Those codes will be removed in the future, you can check it in src/main/kotlin/com/intellij/temporary, if you want to use this plugin in your company, please remove those codes to avoid any legal issues.

This code is distributed under the MPL 2.0 license. See LICENSE in this directory.

auto-dev's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto-dev's Issues

Custom模式下,自定义Custom Engine Prompt 报错

2024-01-08 14:48:59,875 [ 107915]   INFO - #c.u.d.c.a.CustomPromptConfig - Loaded prompt config: CustomPromptConfig(spec={}, prompts=[cc.unitmesh.devti.custom.action.CustomIntentionConfig@630ee774], documentations=null)
2024-01-08 14:48:59,935 [ 107975]   INFO - #c.u.d.c.a.CustomPromptConfig - Loaded prompt config: CustomPromptConfig(spec={}, `prompts=[cc.unitmesh.devti.custom.action.CustomIntentionConfig@21012da9],` documentations=null)
2024-01-08 14:49:02,070 [ 110110]   INFO - #c.u.d.c.a.CustomPromptConfig - Loaded prompt config: CustomPromptConfig(spec={}, prompts=[cc.unitmesh.devti.custom.action.CustomIntentionConfig@58a77216], documentations=null)
2024-01-08 14:49:03,051 [ 111091]   INFO - #c.u.d.c.a.CustomPromptConfig - Loaded prompt config: CustomPromptConfig(spec={}, prompts=[cc.unitmesh.devti.custom.action.CustomIntentionConfig@2e2d671b], documentations=null)
2024-01-08 14:49:03,082 [ 111122]   INFO - STDERR - SLF4J: No SLF4J providers were found.
2024-01-08 14:49:03,084 [ 111124]   INFO - STDERR - SLF4J: Defaulting to no-operation (NOP) logger implementation
2024-01-08 14:49:03,084 [ 111124]   INFO - STDERR - SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
2024-01-08 14:49:03,084 [ 111124]   INFO - STDERR - SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
2024-01-08 14:49:03,085 [ 111125]   INFO - STDERR - SLF4J: Ignoring binding found at [jar:file:/C:/software/JetBrains/IntelliJ%20IDEA%20Community%20Edition%202022.2.5/lib/3rd-party-rt.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2024-01-08 14:49:03,086 [ 111126]   INFO - STDERR - SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
2024-01-08 14:49:03,136 [ 111176] SEVERE - #c.i.i.p.PluginManager - Velocity could not be initialized!
java.lang.RuntimeException: Velocity could not be initialized!
        at org.apache.velocity.runtime.RuntimeInstance.requireInitialization(RuntimeInstance.java:376)
        at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1323)
        at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1433)
        at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1395)
        at org.apache.velocity.app.Velocity.evaluate(Velocity.java:184)
        at cc.unitmesh.devti.custom.CustomActionIntention.buildCustomPrompt(CustomActionIntention.kt:85)
        at cc.unitmesh.devti.custom.CustomActionIntention.invoke(CustomActionIntention.kt:46)
        at cc.unitmesh.devti.intentions.IntentionsActionGroup$getChildren$1$1.invoke(IntentionsActionGroup.kt:25)
        at cc.unitmesh.devti.intentions.IntentionsActionGroup$getChildren$1$1.invoke(IntentionsActionGroup.kt:24)
        at cc.unitmesh.devti.intentions.IntentionsActionGroup.getChildren$lambda$1$lambda$0(IntentionsActionGroup.kt:24)
        at com.intellij.openapi.project.DumbAwareAction$SimpleDumbAwareAction.actionPerformed(DumbAwareAction.java:82)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:315)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:294)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:337)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:294)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$performAction$4(ActionMenuItem.java:293)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:227)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.java:286)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$0(ActionMenuItem.java:67)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$3(ActionMenuItem.java:109)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
        at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
        at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:546)
        at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:578)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6656)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
        at java.desktop/java.awt.Component.processEvent(Component.java:6421)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2804)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:790)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
        at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:763)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:761)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:760)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918)
        at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:840)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:763)
        at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
        at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
        at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624)
        at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447)
        at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: org.apache.velocity.exception.VelocityException: The specified class for ResourceManager (org.apache.velocity.runtime.resource.ResourceManagerImpl) does not implement org.apache.velocity.runtime.resource.ResourceManager; Velocity is not initialized correctly.
at org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:824)
        at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:282)
        at org.apache.velocity.runtime.RuntimeInstance.requireInitialization(RuntimeInstance.java:371)
        ... 66 more
2024-01-08 14:49:03,141 [ 111181] SEVERE - #c.i.i.p.PluginManager - IntelliJ IDEA 2022.2.5  Build #IC-222.4554.10
2024-01-08 14:49:03,142 [ 111182] SEVERE - #c.i.i.p.PluginManager - JDK: 17.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-01-08 14:49:03,143 [ 111183] SEVERE - #c.i.i.p.PluginManager - OS: Windows 7
2024-01-08 14:49:03,144 [ 111184] SEVERE - #c.i.i.p.PluginManager - Plugin to blame: AutoDev version: 1.5.2-222
2024-01-08 14:49:04,223 [ 112263]   INFO - #o.k.p.KafkaStateComponent - Save state:{}{}
2024-01-08 14:49:04,278 [ 112318]   INFO - #c.i.c.ComponentStoreImpl - Saving appFileTypeManager took 15 ms, FindSettings took 13 ms, KeymapManager took 11 ms, KotlinRejectersInfoService took 18 ms
2024-01-08 14:49:05,919 [ 113959]   INFO - #c.u.d.c.a.CustomPromptConfig - Loaded prompt config: CustomPromptConfig(spec={}, prompts=[cc.unitmesh.devti.custom.action.CustomIntentionConfig@212d58b7], documentations=null)
2024-01-08 14:49:06,081 [ 114121]   INFO - #c.i.o.a.i.PopupMenuPreloader - 7134 ms since showing to preload popup menu 'Editor Popup Menu' at 'EditorPopup' in 163 ms

Feature Request: LLM Restful format customizable

Currently Restful format has 2 style, OpenAI and Azure , and Custom means Azure.

should be customizable for:

  • set custom Header (for example: google's PaML2 api not need a Authorization header)
  • append key to Url (for example: google's PaLM2 api append its key in url)
  • customizable request body format

支持TDD开发模式,根据指定测试生成对应实现

本功能可能对应的场景(功能逐步累加):

  1. 实现代码不存在,根据某一个指定的测试生成对应实现
  2. 实现代码已存在,根据新加测试添加/修改实现代码并不破坏原有测试
  3. 实现代码已存在,根据与其相关的测试变动(增、删、改)更新实现代码

json解析异常

填的参数
Custom Request Body Format(Json File):
{"customFields":{"model":"/data/model/deepseek-coder-33b-instruct","stop":["<|im_end>|","|EOT|"],"stream":0}}

完整异常
Failed to parse custom request body

java.lang.IllegalArgumentException: Element class kotlinx.serialization.json.JsonArray is not a JsonPrimitive
	at kotlinx.serialization.json.JsonElementKt.error(JsonElement.kt:326)
	at kotlinx.serialization.json.JsonElementKt.getJsonPrimitive(JsonElement.kt:229)
	at cc.unitmesh.devti.llms.custom.CustomLLMProviderKt.updateCustomBody(CustomLLMProvider.kt:216)
	at cc.unitmesh.devti.llms.custom.CustomLLMProviderKt.updateCustomFormat(CustomLLMProvider.kt:252)
	at cc.unitmesh.devti.llms.custom.CustomLLMProvider.stream(CustomLLMProvider.kt:82)
	at cc.unitmesh.devti.gui.chat.ChatCodingService.makeChatBotRequest(ChatCodingService.kt:84)
	at cc.unitmesh.devti.gui.chat.ChatCodingService.handlePromptAndResponse$lambda$1(ChatCodingService.kt:47)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:249)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:840)

what reason?

java.lang.RuntimeException: java.net.SocketTimeoutException: Connect timed out
at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:45)
at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:90)
at io.reactivex.Single.blockingGet(Single.java:2002)
at com.theokanning.openai.service.OpenAiService.execute(OpenAiService.java:260)
at com.theokanning.openai.service.OpenAiService.createChatCompletion(OpenAiService.java:129)
at cc.unitmesh.devti.connector.openai.OpenAIConnector.prompt(OpenAIConnector.kt:84)
at cc.unitmesh.devti.gui.chat.ChatCodingService.makeChatBotRequest(ChatCodingService.kt:54)
at cc.unitmesh.devti.gui.chat.ChatCodingService.handlePromptAndResponse$lambda$1(ChatCodingService.kt:33)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:246)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.net.SocketTimeoutException: Connect timed out
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at com.theokanning.openai.service.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:28)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall.execute(RealCall.java:81)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:46)
at io.reactivex.Observable.subscribe(Observable.java:10151)
at retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35)
at io.reactivex.Observable.subscribe(Observable.java:10151)
at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35)
at io.reactivex.Single.subscribe(Single.java:2517)
at io.reactivex.Single.blockingGet(Single.java:2001)
... 15 more

custom engine server不生效,并没有请求自定义LLM接口

配置了custom engine server、custom engine token、response format,没有配置customize prompt。在LLM服务端监控autodev插件的调用情况,测试结果如下:

  1. 部分功能不可用,LLM服务端没有收到请求。涉及功能:code complete、explain this、chat with this、chat with xxx(method),大多数功能都没有请求自定义模型接口
  2. 只有autocrud with this 和 generate living doc 这2个功能调用了自定义模型接口,从模型服务端可以看到请求数据和返回。

对照源码:CustomLLMProvider.kt。模型服务入参和返回都没有问题。

感觉插件中上述的几个功能并没有调用自定义模型地址,暂时还没有看到源码,先反馈一下,望回复,谢谢!

升级1.2.2版本之后插件报错,1.2.1版本正常

idea版本:IntelliJ IDEA 2023.2.2 (Ultimate Edition) Build #IU-232.9921.47, built on September 13, 2023
使用场景:配置了custom engine server
问题版本:1.2.2,报错内容如下:
Unhandled exception in [StandaloneCoroutine{Cancelling}@183c00b, Dispatchers.Default]

java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Long.parseLong(Long.java:721)
at java.base/java.lang.Long.parseLong(Long.java:836)
at cc.unitmesh.devti.gui.chat.ChatCodingPanel$updateMessageInUi$3.invokeSuspend(ChatCodingPanel.kt:217)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@183c00b, Dispatchers.Default]

备注:1.2.1版本没有报错,模型返回解析正常

代码回写时报错

报错信息如下:

Access is allowed from event dispatch thread only

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false
...
...

Test data generate for migration

根据《系统重构与迁移指南》的定义,我们将需要实现如下的功能:

  • 基于 Controller 调用链,生成测试场景。
  • 基于函数的输入和输出,生成示例 JSON 数据。
  • 基于场景和数据结构,生成对应的 API 测试代码

Prompt 策略:

  • 当调用链过长时,只捕获异常代码,作为测试场景。

CustomAgent - extends API for code RAG

Generate by ChatGPT

GitHub Issue Roadmap for RebuildWise

Milestone 1: Project Initiation and System Understanding

  1. Issue 2: System Analysis with LLM

    • Description: Use LLM to analyze the existing legacy system's source code, data structures, and documentation. Document key findings.
    • Labels: system-analysis, documentation
  2. Issue 3: Requirements Gathering with RAG

    • Description: Utilize RAG to retrieve and compile domain-specific knowledge for gathering and documenting user requirements.
    • Labels: requirements, research

Milestone 2: Refactoring Planning

  1. Issue 4: Initial Refactoring Plan with LLM

    • Description: Generate an initial refactoring plan using LLM, including high-level architecture design and technology stack selection.
    • Labels: refactoring-plan, architecture
  2. Issue 5: Best Practices Research with RAG

    • Description: Use RAG to find information on best practices and case studies related to legacy system refactoring. Integrate these insights into the refactoring plan.
    • Labels: best-practices, research

Milestone 3: Implementation and Testing

  1. Issue 6: Code Generation with LLM

    • Description: Employ LLM to generate code for standard tasks and modules, streamlining the development process.
    • Labels: code-generation, development
  2. Issue 7: Test Case Generation with LLM

    • Description: Utilize LLM to automatically create test cases and test data, ensuring thorough testing of the refactored system.
    • Labels: testing, quality-assurance

Milestone 4: Documentation and Knowledge Sharing

  1. Issue 8: Documentation Enhancement with LLM

    • Description: Use LLM to improve system documentation, making it more comprehensive and user-friendly.
    • Labels: documentation, knowledge-sharing
  2. Issue 9: Technical Support with LLM

    • Description: Implement LLM-powered technical support to assist developers in troubleshooting, performance optimization, and security enhancements.
    • Labels: technical-support, development

This roadmap provides a structured plan for the RebuildWise project, with a focus on leveraging LLM and RAG throughout the different stages of system refactoring. You can create these GitHub issues in your repository and assign them to relevant team members, setting priorities and due dates as needed. Remember to adapt the roadmap based on your project's specific requirements and goals.

213版本不兼容,代码无法build

以下文件报错:

  1. AutoDevToolWindowFactory.kt:24:28 Unresolved reference: getInstance
  2. CoUnitToolConfigurable.kt:36:21 Cannot find a parameter with this name: prop
  3. TeamPromptsConfigurable.kt:26:21 Cannot find a parameter with this name: prop

1.2.1 版本之后,模型返回的数据流输出不对

          > @phodal 升级1.2.3不报错,但是模型返回的数据流没有正常输出。回滚到1.2.1版本之后一切正常。 模型服务一直没有改过,输入输出都是按照文档要求。 从现象看,就是1.2.1之后的版本对返回数据解析做了调整

建议新起个 issue

Originally posted by @hotip in #47 (comment)

When I try to use `test it` the following error occurred. java.lang.Throwable: Could not find WriteTestService for xxx

  • Goland: GoLand 2023.3.2
  • AutoDev: 1.5.3-233
  • error detail
java.lang.Throwable: Could not find WriteTestService for: JSFile:test.js
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at cc.unitmesh.devti.intentions.action.task.TestCodeGenTask.run(TestCodeGenTask.kt:43)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:434)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:132)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:484)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:248)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:73)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:192)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:179)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:73)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:248)
	at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:498)
	at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
	at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
	at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
	at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:464)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:840)

request rate limit

consider provide setting to limit request rate

com.theokanning.openai.OpenAiHttpException: Rate limit reached for default-gpt-3.5-turbo in organization org-lpTV8JA1Fonfq3PljHSxtabv on requests per min. Limit: 3 / min. Please try again in 20s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.
	at com.theokanning.openai.service.ResponseBodyCallback.onResponse(ResponseBodyCallback.java:53)
	at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:504)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'committer' at row 1

in context with path [] threw exception [Request processing failed; nested exception is org.jdbi.v3.core.statement.UnableToExecuteStatementException: java.sql.BatchUpdateException: Data truncation: Data too long for column 'committer' at row 1 [statement:"
archguard-backend | INSERT INTO scm_change_entry (system_id,old_path,new_path,commit_time,cognitive_complexity,change_mode,commit_id,committer,line_added,line_deleted)
archguard-backend | VALUES (:systemId,:item.oldPath,:item.newPath,:item.commitTime,:item.cognitiveComplexity,:item.changeMode,:item.commitId,:item.committer,:item.lineAdded,:item.lineDeleted)
archguard-backend | ON DUPLICATE KEY UPDATE commit_id=commit_id

java.lang.Throwable: Read access is allowed from inside read-action (or EDT)

IDEA版本: IntelliJ IDEA 2023.1 (Ultimate Edition) Build #IU-231.8109.175, built on March 28, 2023

配置好之后报错如下:

java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction())
Current thread: Thread[ApplicationImpl pooled thread 43,4,main] 21718972 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 854203447
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1004)
	at com.intellij.psi.impl.source.PsiFileImpl.assertReadAccessAllowed(PsiFileImpl.java:184)
	at com.intellij.psi.impl.source.PsiFileImpl.getStubTree(PsiFileImpl.java:621)
	at com.intellij.psi.impl.source.PsiFileImpl.getGreenStubTree(PsiFileImpl.java:956)
	at com.intellij.psi.impl.source.SpineRef.getGreenStub(SpineRef.java:36)
	at com.intellij.extapi.psi.StubBasedPsiElementBase.getGreenStub(StubBasedPsiElementBase.java:352)
	at com.intellij.extapi.psi.StubBasedPsiElementBase.getParent(StubBasedPsiElementBase.java:314)
	at cc.unitmesh.devti.actions.CodeCompleteAction$actionPerformed$task$1.run(CodeCompleteAction.kt:41)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:480)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

关于添加 gitlab 的支持

如果谈论到私有化,那么大量的开发团队还使用了Gitlab 作为代码托管管理工具,是否应该添加支持,配置项目应该放在哪里合适?
我在老版本已经加过了不过更新之后没找到原先放github token 的地方

Prompts Override

Can directly override default template if same in prompts, like prompts/genius/code-review.vm

custom配置咨询

image

使用的是1.5.1-222版本的插件,AI Engine选择了Custom,请问Custom Request Body Format (Json Path) 这个选项怎么配置,我这边一直报Failed to parse custom request body的错误

自定义本地模型不能正常接收sse响应

相同的请求,只修改response type:
如果是json可以看到有流式返回,但是插件没有打印返回;
如果是sse则可以从我们的服务看到响应体里什么都没有。

解析response时报错

image

这是我的配置信息

image

这个IDEA的日志,获取response之后解析报错,请问这个是什么原因,跟jdk版本有关系吗,我这边用的是1.8

1.0版本运行devti://story/github/1报错

java.util.NoSuchElementException: Collection contains no element matching the predicate.
at cc.unitmesh.idea.spring.JavaSpringCodeCreator.createControllerOrUpdateMethod(JavaSpringCodeCreator.kt:282)
at cc.unitmesh.idea.flow.provider.JvmAutoDevFlow.createCode(JvmAutoDevFlow.kt:220)
at cc.unitmesh.idea.flow.provider.JvmAutoDevFlow.createCodeByType(JvmAutoDevFlow.kt:208)
at cc.unitmesh.idea.flow.provider.JvmAutoDevFlow.createCodeByType$default(JvmAutoDevFlow.kt:202)
at cc.unitmesh.idea.flow.provider.JvmAutoDevFlow.createServiceFile(JvmAutoDevFlow.kt:186)
at cc.unitmesh.idea.flow.provider.JvmAutoDevFlow.updateOrCreateServiceAndRepository(JvmAutoDevFlow.kt:141)
at cc.unitmesh.devti.runconfig.AutoDevRunProfileState$executeCrud$1.run(AutoDevRunProfileState.kt:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:480)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)

new chat不生效

autodev配置了自定义custom engine server
case描述:autodev插件端点击"new chat",同时关闭当前“code”对话框。这种情况下,按道理下次对话应该重置并开启新一轮对话,但实际不是。
重新使用autodev中随便一个功能,模型服务端依然会收到上一轮对话中全部message。
只有重新启动IDEA才会开启新一轮对话。

github repo 的 description 是否必要?

使用插件的时候简单新建了一个repo用来存储用户故事,调用报错 java.lang.NullPointerException: repo.description must not be null
我看了一下代码感觉 repo.description 非必要
是否考虑去除?

科大讯飞星火模型 API && API 重构

LLMProvider api 设计不太适合当前 LLM 模型需求。

/**
 * LLMProvider provide only session-free interfaces
 *
 * It's LLMProvider's responsibility to maintain the network connection
 * But the chat session is maintained by the client
 *
 * The implementations should provide a way to convert the response to a ChatSession
 */
abstract class LLMProvider<M : ChatMessage> {

    // observe response
    abstract val response: Flow<ChatSession<M>>
    // send request
    abstract fun textComplete(session: ChatSession<ChatMessage>)
    // send image request
    abstract fun imageGenerate(prompt: String): Flow<ChatSession<M>>
    // response json to ChatSession Data transformer
    protected abstract fun responseToChatSession(sendingSession: ChatSession<M>, responseBody: String): ChatSession<M>
}

https://gist.github.com/hotip/0514521ffee37c3b49cef52dbad96f16

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.