Skip to content

Commit

Permalink
Initialized project
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammedsaidckr committed Feb 18, 2024
0 parents commit 919640f
Show file tree
Hide file tree
Showing 38 changed files with 6,399 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**/.gitattributes export-ignore
**/.gitignore export-ignore
**/.gitmodules export-ignore
**/.github export-ignore
**/.travis export-ignore
**/.travis.yml export-ignore
**/.editorconfig export-ignore
**/.styleci.yml export-ignore

**/phpunit.xml export-ignore
**/tests export-ignore

**/js/dist/**/* -diff
**/js/dist/**/* linguist-generated
**/js/dist-typings/**/* -diff
**/js/dist-typings/**/* linguist-generated
**/js/yarn.lock -diff
**/js/package-lock.json -diff

* text=auto eol=lf
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/vendor
composer.lock
composer.phar

.DS_Store
Thumbs.db
tests/.phpunit.result.cache
/tests/integration/tmp
.vagrant
.idea/*
.vscode
js/coverage-ts
14 changes: 14 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
preset: recommended

enabled:
- logical_not_operators_with_successor_space

disabled:
- align_double_arrow
- blank_line_after_opening_tag
- multiline_array_trailing_comma
- new_with_braces
- phpdoc_align
- phpdoc_order
- phpdoc_separation
- phpdoc_types
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Gemini

![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/muhammedsaidckr/flarum-gemini.svg)](https://packagist.org/packages/muhammedsaidckr/flarum-gemini) [![Total Downloads](https://img.shields.io/packagist/dt/muhammedsaidckr/flarum-gemini.svg)](https://packagist.org/packages/muhammedsaidckr/flarum-gemini)

A [Flarum](http://flarum.org) extension. This extension integrates the power of gemini within the Flarum platform, enabling seamless AI-powered conversation capabilities for users.

## Installation

Install with composer:

```sh
composer require muhammedsaidckr/flarum-gemini:"*"
```

## Updating

```sh
composer update muhammedsaidckr/flarum-gemini:"*"
php flarum migrate
php flarum cache:clear
```

## References (demo)
- [Ne Istersen Sor](https://neistersensor.com/)



## Links

- [Packagist](https://packagist.org/packages/muhammedsaidckr/flarum-gemini)
- [GitHub](https://github.com/muhammedsaidckr/flarum-gemini)
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)
83 changes: 83 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"name": "muhammedsaidckr/flarum-gemini",
"description": "This extension integrates the power of Gemini within the Flarum platform, enabling seamless AI-powered conversation capabilities for users.",
"keywords": [
"flarum"
],
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": "^1.2.0",
"blomstra/database-queue": "^1.0.0",
"google-gemini-php/client": "^1.0"
},
"authors": [
{
"name": "Muhammed Said Cakir",
"email": "[email protected]",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Msc\\Gemini\\": "src/"
}
},
"extra": {
"flarum-extension": {
"title": "Gemini",
"category": "feature",
"icon": {
"image": "icon.svg"
}
},
"flarum-cli": {
"modules": {
"admin": true,
"forum": true,
"js": true,
"jsCommon": true,
"css": true,
"locale": true,
"gitConf": true,
"githubActions": true,
"prettier": true,
"typescript": true,
"bundlewatch": false,
"backendTesting": true,
"editorConfig": true,
"styleci": true
}
}
},
"minimum-stability": "stable",
"prefer-stable": true,
"autoload-dev": {
"psr-4": {
"Msc\\Gemini\\Tests\\": "tests/"
}
},
"scripts": {
"test": [
"@test:unit",
"@test:integration"
],
"test:unit": "phpunit -c tests/phpunit.unit.xml",
"test:integration": "phpunit -c tests/phpunit.integration.xml",
"test:setup": "@php tests/integration/setup.php"
},
"scripts-descriptions": {
"test": "Runs all tests.",
"test:unit": "Runs all unit tests.",
"test:integration": "Runs all integration tests.",
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
},
"require-dev": {
"flarum/testing": "^1.0.0"
},
"config": {
"allow-plugins": {
"php-http/discovery": true
}
}
}
42 changes: 42 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/*
* This file is part of muhammedsaidckr/flarum-gemini.
*
* Copyright (c) 2023 Muhammed Said Cakir.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace Msc\Gemini;

use Flarum\Discussion\Event\Started;
use Flarum\Extend;
use Msc\Gemini\Listener\ReplyToPost;

return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/less/admin.less'),
(new Extend\Locales(__DIR__.'/locale')),

(new Extend\ServiceProvider())
->register(BindingsProvider::class)
->register(ClientProvider::class),

(new Extend\Event())
->listen(Started::class, ReplyToPost::class),

(new Extend\Settings())
->default('muhammedsaidckr-gemini.model', 'gemini-pro')
->default('muhammedsaidckr-gemini.enable_on_discussion_started', true)
->default('muhammedsaidckr-gemini.max_tokens', 100)
->default('muhammedsaidckr-gemini.user_prompt_badge_text', 'Assistant')
->default('muhammedsaidckr-gemini.user_prompt', 1)
->serializeToForum('GeminiUserPromptId', 'muhammedsaidckr-gemini.user_prompt')
->serializeToForum('GeminiBadgeText', 'muhammedsaidckr-gemini.user_prompt_badge_text'),
];
40 changes: 40 additions & 0 deletions icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

node_modules
2 changes: 2 additions & 0 deletions js/admin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './src/common';
export * from './src/admin';
Loading

0 comments on commit 919640f

Please sign in to comment.