Commit Graph

480 Commits

Author SHA1 Message Date
di-sukharev
676c2b20c1 update package-lock.json 2024-08-27 16:58:22 +03:00
di-sukharev
21da102f6d Merge remote-tracking branch 'origin/dev' into refactoring_v1 2024-08-27 16:57:54 +03:00
di-sukharev
6ae7ce2720 chore(config.ts): remove debug console log to clean up the code and improve readability 2024-08-27 16:49:17 +03:00
di-sukharev
e44610fea3 chore(.gitignore): add notes.md to .gitignore to prevent tracking of notes files 2024-08-27 16:49:03 +03:00
Takanori Matsumoto
68c9ed359c fix(dependencies): update tr46, webidl-conversions, and whatwg-url to latest versions for compatibility and security improvements (#395) 2024-08-26 10:28:34 +03:00
di-sukharev
9dcb264420 test(config.test.ts): refactor generateConfig function to accept an object for content to improve readability and maintainability 2024-08-20 21:36:00 +03:00
di-sukharev
dd7fdba94e fix(config.ts): revert OCO_GITPUSH to its original position in the config object for clarity
refactor(config.ts): rename configFromEnv to envConfig for better readability
refactor(gemini.ts): simplify client initialization in the Gemini constructor
test(config.test.ts): add test case to check overriding global config with null values in local .env
test(gemini.test.ts): update AI provider assignment to use OCO_AI_PROVIDER_ENUM for consistency
2024-08-20 21:32:16 +03:00
di-sukharev
5fa12e2d4a feat(config): export OCO_AI_PROVIDER_ENUM to allow external access to AI provider constants
refactor(config): simplify mergeObjects function to improve readability and maintainability
refactor(setConfig): remove unnecessary keysToSet variable to streamline logging
refactor(engine): update switch cases to use OCO_AI_PROVIDER_ENUM for better consistency and clarity
2024-08-20 15:37:41 +03:00
di-sukharev
42a36492ad build 2024-08-20 15:37:33 +03:00
di-sukharev
443d27fc8d chore(docs): mark "Push to git" section in README as deprecated to inform users of upcoming changes
refactor(commit.ts): remove early return for non-pushing users to streamline commit process
refactor(config.ts): add deprecation comments for OCO_GITPUSH to indicate future removal
test(config.test.ts): enhance tests to ensure correct handling of local and global config priorities
test(gemini.test.ts): improve tests for Gemini class to ensure proper functionality and error handling
2024-08-20 15:34:09 +03:00
di-sukharev
04991dd00f fix(engine.ts): include DEFAULT_CONFIG in Gemini and Azure engine instantiation to ensure consistent configuration across engines 2024-08-20 12:58:00 +03:00
di-sukharev
3ded6062c1 fix: remove optional chaining from config access to ensure compatibility and prevent potential runtime errors
refactor(flowise.ts, ollama.ts): update axios client configuration to use a consistent URL format for API requests
fix: update README example to reflect the removal of optional chaining in config access
2024-08-20 12:32:40 +03:00
di-sukharev
f8584e7b78 refactor(engine): rename basePath to baseURL for consistency across interfaces and implementations
fix(engine): update Azure and Flowise engines to use baseURL instead of basePath for API configuration
fix(engine): adjust Ollama engine to handle baseURL and fallback to default URL
style(engine): clean up constructor formatting in OpenAiEngine for better readability
chore(engine): update getEngine function to use baseURL in configuration for all engines
2024-08-20 12:21:13 +03:00
di-sukharev
94faceefd3 remove mb confusing line 2024-08-20 12:06:01 +03:00
di-sukharev
720cd6f9c1 clear readme 2024-08-20 12:05:15 +03:00
di-sukharev
b6a92d557f docs(README.md): update author section and clarify API key storage details
docs(README.md): improve instructions for using OpenCommit CLI and configuration
fix(README.md): correct default model name to gpt-4o-mini in usage examples
fix(package.json): update openai package version to 4.56.0 for compatibility
2024-08-20 12:04:07 +03:00
di-sukharev
71354e4687 feat: add CommandsEnum to define command constants for better maintainability
refactor(generateCommitMessageFromGitDiff): update types for OpenAI messages to improve type safety
fix(commitlint/config): remove optional chaining for OCO_LANGUAGE to ensure proper access
refactor(commitlint/prompts): update types for OpenAI messages to improve type safety
refactor(prompts): update types for OpenAI messages to improve type safety
2024-08-20 12:03:40 +03:00
di-sukharev
8f85ee8f8e refactor(testAi.ts): update import statements to use OpenAI type for better clarity and maintainability
fix(testAi.ts): change parameter type in generateCommitMessage method to align with OpenAI's updated type definitions
2024-08-20 12:01:51 +03:00
di-sukharev
f9103a3c6a build 2024-08-20 12:01:38 +03:00
di-sukharev
4afd7de7a8 feat(commands): add COMMANDS enum to standardize command names across the application
refactor(commit.ts): restructure generateCommitMessageFromGitDiff function to use an interface for parameters and improve readability
fix(config.ts): update DEFAULT_TOKEN_LIMITS to correct values for max tokens input and output
chore(config.ts): enhance config validation to handle undefined and null values more effectively
style(commit.ts): improve formatting and consistency in the commit confirmation logic
style(config.ts): clean up error messages and improve clarity in config setting process
2024-08-20 12:01:14 +03:00
di-sukharev
5cfa3cded2 feat(engine): refactor AI engine interfaces and implementations to support multiple AI providers and improve configurability
- Introduce `AiEngineConfig` interface for consistent configuration across AI engines.
- Update `generateCommitMessage` method signatures to use `OpenAIClient.Chat.Completions.ChatCompletionMessageParam`.
- Implement specific configurations for each AI provider (Anthropic, Azure, Gemini, Ollama, OpenAI) to enhance flexibility.
- Replace hardcoded values with configurable parameters for model, API key, and token limits.
- Refactor client initialization to use Axios instances for better HTTP request handling.
- Remove deprecated code and improve error handling for better user feedback.
2024-08-20 11:58:19 +03:00
di-sukharev
bb0b0e804e build 2024-08-20 11:56:44 +03:00
di-sukharev
5d87cc514b feat(ENUMS.ts): add ENUMS file to centralize command constants
refactor(commitlint.ts): update import path to use ENUMS for command constants
refactor(config.ts): update import path to use ENUMS for command constants
refactor(githook.ts): update import path to use ENUMS for command constants
fix(prompts.ts): correct conventional commit keywords instruction text
2024-08-19 14:09:27 +03:00
di-sukharev
6f4e8fde93 docs(README.md): update usage examples to remove redundant 'opencommit' command
chore(example.txt): remove unused example.txt file
fix(config.ts): correct import order and improve validation messages
fix(githook.ts): improve error message for unsupported mode
fix(azure.ts): add non-null assertion for message content
fix(gemini.ts): use strict equality for role comparison
refactor(generateCommitMessageFromGitDiff.ts): reorder imports for consistency
refactor(github-action.ts): reorder imports for consistency
refactor(prompts.ts): simplify prompt content generation and improve readability
style(engine.ts): fix inconsistent spacing and import order
2024-08-19 14:00:08 +03:00
di-sukharev
745bb5218f update imports 2024-08-19 13:09:46 +03:00
di-sukharev
eb3be62a4f 3.0.20 v3.0.20 2024-08-19 12:34:35 +03:00
di-sukharev
58ad1880ef Merge remote-tracking branch 'origin/dev' into marcelwiegand-master 2024-08-19 12:29:55 +03:00
marcelwiegand
5ee17235cb 🐛(anthropic.ts): fix incorrect usage of 'typeof' operator for MODEL variable 2024-08-19 11:13:37 +02:00
marcelwiegand
f9c7316eb3 🐛(openAi.ts): fix incorrect usage of 'typeof' operator for MODEL variable 2024-08-19 11:13:09 +02:00
di-sukharev
dfe2730a45 build 2024-08-19 10:42:36 +03:00
GPT10
a979ba091a 3.0.19 (#384)
* fix(config.ts): move 'gpt-4o-mini' in MODEL_LIST
* docs(config.ts): update API key validation message with detailed instructions
* refactor(config.ts): simplify model validation logic to check for string type instead of MODEL_LIST

* 3.0.19
2024-08-19 10:41:26 +03:00
di-sukharev
6bbe07a9a1 build 2024-08-19 10:28:45 +03:00
di-sukharev
0156bb9dc9 3.0.19 v3.0.19 2024-08-19 10:26:46 +03:00
di-sukharev
e27bbd0ac1 fix(config.ts): move 'gpt-4o-mini' in MODEL_LIST
docs(config.ts): update API key validation message with detailed instructions
refactor(config.ts): simplify model validation logic to check for string type instead of MODEL_LIST
2024-08-19 10:25:24 +03:00
GPT10
f3371ac1e3 3.0.18 (#382)
* 📝 (README.md): add support for custom AI models and update documentation to reflect new environment variable OCO_ AI_PROVIDER (#351)

* feat/add gemini (#349)

* fix: prompt-module/@commitlint (#336)

* docs: spelling fix (#325)

---------

Co-authored-by: tumf <y.takahara@gmail.com>
Co-authored-by: Drew Payment <drew.payment@gmail.com>
Co-authored-by: Takanori Matsumoto <matscube@gmail.com>
Co-authored-by: Kellan Stevens <kellan@kellanstevens.com>
Co-authored-by: JMN09 <jmn09@mail.aub.edu>
Co-authored-by: JMN09 <157629053+JMN09@users.noreply.github.com>
2024-08-18 14:55:33 +03:00
di-sukharev
9cc9f9d757 build 2024-08-18 14:47:25 +03:00
di-sukharev
c8d5c53db1 3.0.18 v3.0.18 2024-08-18 14:47:23 +03:00
di-sukharev
fc4326233d Merge remote-tracking branch 'origin/master' into dev 2024-08-18 14:23:26 +03:00
XIAOTIAN LIU
07f7a05c4b support read OCO_OLLAMA_API_URL from env to OllamaAiEngine and fix bug in getting ollma model name when slash exists (#375) 2024-08-18 14:22:30 +03:00
di-sukharev
9b2e41d255 fix(package.json): add override for whatwg-url to version 13.0.0 to fix punnycode warning 2024-08-18 14:21:27 +03:00
di-sukharev
6fad862aa5 Merge remote-tracking branch 'origin/master' into dev 2024-08-18 14:04:27 +03:00
XiaomaiTX
c425878f21 feat: allow any string as model (#367)
* refactor(anthropic.ts, openAi.ts): remove model validation against predefined list to allow any string as model, simplifying configuration and improving flexibility
2024-08-18 13:47:18 +03:00
di-sukharev
1fb592afb2 Merge branch 'murex-feature/Flowise' into dev 2024-08-18 13:42:19 +03:00
di-sukharev
684f3dadfc build 2024-08-18 13:41:58 +03:00
di-sukharev
76e6070012 Merge branch 'feature/Flowise' of github.com:murex/opencommit into murex-feature/Flowise 2024-08-18 13:41:38 +03:00
di-sukharev
cb72837866 build 2024-08-18 13:36:02 +03:00
di-sukharev
2432ef9de3 Merge remote-tracking branch 'origin/master' into dev 2024-08-18 13:35:38 +03:00
JMN09
026fd1822a Merge branch 'dev' into feature/Flowise
# Conflicts:
#	out/cli.cjs
#	out/github-action.cjs
#	src/commands/config.ts
#	src/utils/engine.ts
2024-08-14 15:30:12 +03:00
JMN09
b42a52ef24 Merge branch 'master' of https://github.com/murex/opencommit into feature/Flowise 2024-08-13 16:26:25 +03:00
XYCode Kerman
10b031ab36 fix(i18n): zh_CN is wrong (#379) 2024-08-13 10:59:48 +03:00