Skip to content

Commit

Permalink
Merge pull request #13 from bootstrapguru/dev
Browse files Browse the repository at this point in the history
Dexor 1.1
  • Loading branch information
vijaythecoder authored Jul 14, 2024
2 parents 2140e02 + 8eba87d commit 7377751
Show file tree
Hide file tree
Showing 57 changed files with 2,883 additions and 648 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug Report
about: Create a report to help us improve the project
title: "[Bug Report]: [Title]"
labels: bug
assignees: ''

---

## Describe the Bug
<!-- A clear and concise description of what the bug is. -->

## To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->

## Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

## Desktop (please complete the following information):
- OS: [e.g. Windows, macOS, Linux]
- Terminal: [e.g. bash, zsh, cmd, powershell]
- Version [e.g. 0.1.2]

## Additional Context
<!-- Add any other context about the problem here. -->
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Enhancement Request
about: Suggest an improvement or optimization for this project
title: "[Enhancement]: [Title]"
labels: enhancement
assignees: ''

---

## Summary
<!-- Provide a summary of the enhancement you would like to see implemented. -->

## Current Behavior
<!-- Describe the current behavior that you think needs improvement. -->

## Desired Behavior
<!-- Describe the behavior or feature you would like to see. -->

## Suggested Solution
<!-- Suggest your solution or improvement. -->

## Additional Context
<!-- Provide any other context or screenshots related to the enhancement request here. -->
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature Request
about: Suggest a new feature or idea for this project
title: "[Feature Request]: [Title]"
labels: feature request
assignees: ''

---

## Summary
<!-- Provide a summary of the feature you would like to see implemented. -->

## Motivation
<!-- Why do you want this feature? What problem does it solve? Why is it important to have this feature? -->

## Detailed Description
<!-- Provide a detailed description of the feature. Include any benefits, goals, and expected outcomes. -->

## Alternatives
<!-- Are there any alternative solutions or features you've considered? If so, provide those details here. -->

## Additional Context
<!-- Provide any other context or screenshots about the feature request here. -->
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# 🤖 Droid
# 🤖 Dexor

Welcome to **Droid**, your trusty companion for automating and streamlining your development tasks. Droid is here to help you stay productive by automating repetitive tasks, identifying and fixing bugs, writing comprehensive test cases, and maintaining a consistent codebase. Checkout the [documentation](https://docs.droids.dev/) to get started!
Welcome to **Dexor**, your trusty companion for automating and streamlining your development tasks. Dexor is here to help you stay productive by automating repetitive tasks, identifying and fixing bugs, writing comprehensive test cases, and maintaining a consistent codebase. Checkout the [documentation](https://docs.dexors.dev/) to get started!

Checkout the youtube video [here](https://youtu.be/oLmbafcHCKg)

<p align="center">
<a href="https://packagist.org/packages/bootstrapguru/droid"><img src="https://img.shields.io/packagist/dt/bootstrapguru/droid.svg" alt="Total Downloads" /></a>
<a href="https://packagist.org/packages/bootstrapguru/droid"><img src="https://img.shields.io/packagist/v/bootstrapguru/droid.svg?label=stable" alt="Latest Stable Version" /></a>
<a href="https://packagist.org/packages/bootstrapguru/droid"><img src="https://img.shields.io/packagist/l/bootstrapguru/droid.svg" alt="License" /></a>
<a href="https://packagist.org/packages/bootstrapguru/dexor"><img src="https://img.shields.io/packagist/dt/bootstrapguru/dexor.svg" alt="Total Downloads" /></a>
<a href="https://packagist.org/packages/bootstrapguru/dexor"><img src="https://img.shields.io/packagist/v/bootstrapguru/dexor.svg?label=stable" alt="Latest Stable Version" /></a>
<a href="https://packagist.org/packages/bootstrapguru/dexor"><img src="https://img.shields.io/packagist/l/bootstrapguru/dexor.svg" alt="License" /></a>
</p>
<img src="https://raw.githubusercontent.com/bootstrapguru/droid.dev/main/resources/images/droid.webp">
<img src="https://raw.githubusercontent.com/bootstrapguru/dexor.dev/main/resources/images/dexor.webp">

## Documentation

For full documentation, getting started guides, and advanced usage, please visit [docs.droids.dev](https://docs.droids.dev/).
For full documentation, getting started guides, and advanced usage, please visit [docs.dexors.dev](https://docs.dexors.dev/).

## License

Droid is an open-source software licensed under the GPL v3 license.
Dexor is an open-source software licensed under the GPL v3 license.
30 changes: 20 additions & 10 deletions app/Commands/DroidCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@
namespace App\Commands;

use App\Services\ChatAssistant;
use App\Tools\ExecuteCommand;
use App\Utils\OnBoardingSteps;
use Exception;
use Illuminate\Console\Command;

use function Termwind\ask;
use function Termwind\render;

class DroidCommand extends Command
class DexorCommand extends Command
{
public $signature = 'droid';
public $signature = 'dexor {--new : Create a new assistant}';

public $description = 'Allows you to create/update a feature';
public $description = 'Allows you to create/update a feature, run commands, and create a new assistant';

public function __construct(
private readonly ChatAssistant $chatAssistant,
private readonly ExecuteCommand $executeCommand
) {
parent::__construct();
}

/**
* @throws Exception
Expand All @@ -26,12 +33,11 @@ public function handle(): int
return self::FAILURE;
}

$chatAssistant = new ChatAssistant;
$thread = $chatAssistant->createThread();
if ($this->option('new')) {
$this->chatAssistant->createNewAssistant();
}

render(view('assistant', [
'answer' => 'How can I help you today?',
]));
$thread = $this->chatAssistant->createThread();

while (true) {
$message = ask('<span class="mt-1 mx-1">🍻:</span>');
Expand All @@ -40,7 +46,11 @@ public function handle(): int
break;
}

$chatAssistant->getAnswer($thread, $message);
if (str_starts_with($message, '/')) {
$this->executeCommand->handle(substr($message, 1));
} else {
$this->chatAssistant->getAnswer($thread, $message);
}
}

return self::SUCCESS;
Expand Down
12 changes: 12 additions & 0 deletions app/Data/AIModelData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Data;

use Spatie\LaravelData\Data;

class AIModelData extends Data
{
public function __construct(
public string $name
) {}
}
18 changes: 18 additions & 0 deletions app/Data/MessageData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Data;

use Illuminate\Support\Collection;
use Spatie\LaravelData\Data;

class MessageData extends Data
{
public function __construct(
public string $role,
public ?string $content,
public ?string $tool_call_id,
public ?string $tool_name,
/** @var Collection<int, ToolCallData> */
public ?Collection $tool_calls
) {}
}
14 changes: 14 additions & 0 deletions app/Data/ToolCallData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Data;

use Spatie\LaravelData\Data;

class ToolCallData extends Data
{
public function __construct(
public string $id,
public string $type,
public ToolFunctionData $function,
) {}
}
13 changes: 13 additions & 0 deletions app/Data/ToolFunctionData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Data;

use Spatie\LaravelData\Data;

class ToolFunctionData extends Data
{
public function __construct(
public string $name,
public string $arguments,
) {}
}
36 changes: 36 additions & 0 deletions app/Integrations/Claude/ClaudeAIConnector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Integrations\Claude;

use Saloon\Http\Connector;
use Saloon\Traits\Plugins\AcceptsJson;
use Saloon\Traits\Plugins\AlwaysThrowOnErrors;
use Saloon\Traits\Plugins\HasTimeout;

class ClaudeAIConnector extends Connector
{
use AcceptsJson, AlwaysThrowOnErrors, HasTimeout;

protected int $connectTimeout = 60;

protected int $requestTimeout = 120;

/**
* The Base URL of the API
*/
public function resolveBaseUrl(): string
{
return 'https://api.anthropic.com/v1';
}

/**
* Default headers for every request
*/
protected function defaultHeaders(): array
{
return [
'x-api-key' => config('aiproviders.claude.api_key'),
'anthropic-version' => '2023-06-01',
];
}
}
Loading

0 comments on commit 7377751

Please sign in to comment.