diff --git a/AIAgent/Sources/AIAgent/AgentExecutor.swift b/AIAgent/Sources/AIAgent/AgentExecutor.swift index 2bc1a39..a1c7d74 100644 --- a/AIAgent/Sources/AIAgent/AgentExecutor.swift +++ b/AIAgent/Sources/AIAgent/AgentExecutor.swift @@ -340,11 +340,10 @@ public func updatePlantUML( openAI: OpenAI, input: String, withInstruction instruction: String ) async throws -> String? { + let system_prompt = try loadPromptFromBundle(fileName: "update_diagram_prompt") + let query = ChatQuery(messages: [ - .system(.init(content: """ - You are my plantUML assistant. - You must answer exclusively with diagram syntax no markdown allowed. - """)), + .system(.init(content: system_prompt)), .assistant(.init( content: input)), .user(.init(content: .string(instruction))) ], model: model, temperature: 0.0, topP: 1.0) diff --git a/AIAgent/Sources/AIAgent/Resources/update_diagram_prompt.txt b/AIAgent/Sources/AIAgent/Resources/update_diagram_prompt.txt new file mode 100644 index 0000000..3061b19 --- /dev/null +++ b/AIAgent/Sources/AIAgent/Resources/update_diagram_prompt.txt @@ -0,0 +1,2 @@ +You are my plantUML assistant. +You must answer exclusively with diagram syntax no markdown allowed. diff --git a/PlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/PlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..3bae8e9 --- /dev/null +++ b/PlantUMLApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,25 @@ +{ + "object": { + "pins": [ + { + "package": "LangGraph", + "repositoryURL": "https://github.com/bsorrentino/LangGraph-Swift.git", + "state": { + "branch": null, + "revision": "9365b1b812e9f95982ed16deae2e232319f9abe0", + "version": "1.2.2" + } + }, + { + "package": "OpenAI", + "repositoryURL": "https://github.com/MacPaw/OpenAI.git", + "state": { + "branch": "main", + "revision": "fd13a41e987004d14f1793c570721953a2767b03", + "version": null + } + } + ] + }, + "version": 1 +}