Upsonic / Server

Self-Driven Autonomous Python Libraries
https://docs.upsonic.co
MIT License
10 stars 2 forks source link

Sweep: create a chat function like completion in upsonic_on_prem/utils/ai/ai.py #87

Open onuratakan opened 8 months ago

onuratakan commented 8 months ago
Checklist - [X] Modify `upsonic_on_prem/utils/ai/ai.py` ✓ https://github.com/Upsonic/On-Prem/commit/80d2fda59906c473dcf52e06587a74d1b4439172 [Edit](https://github.com/Upsonic/On-Prem/edit/sweep/create_a_chat_function_like_completion_i/upsonic_on_prem/utils/ai/ai.py) - [X] Running GitHub Actions for `upsonic_on_prem/utils/ai/ai.py` ✓ [Edit](https://github.com/Upsonic/On-Prem/edit/sweep/create_a_chat_function_like_completion_i/upsonic_on_prem/utils/ai/ai.py)
onuratakan commented 8 months ago

🚀 Here's the PR! #88

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: None)

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/Upsonic/On-Prem/blob/32357642dd961fdf0b6cc8d56ee91eff372ce0a2/upsonic_on_prem/utils/ai/ai.py#L1-L397

Step 2: ⌨️ Coding

--- 
+++ 
@@ -395,4 +395,11 @@

         return result

+    def chat(self, input_text, model="gpt-3.5-turbo"):
+        try:
+            return self.gpt(input_text, model=model)
+        except Exception as e:
+            failed(f"Failed to generate chat response: {e}")
+            return None
+
 AI = AI_()

Ran GitHub Actions for 80d2fda59906c473dcf52e06587a74d1b4439172:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/create_a_chat_function_like_completion_i.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.

This is an automated message generated by Sweep AI.