Skip to content

Commit

Permalink
Merge branch 'alpha' into telemetry2
Browse files Browse the repository at this point in the history
 Conflicts:
	src/features/Chat/Thread/actions.ts

 Changes to be committed:
	modified:   package-lock.json
	modified:   package.json
	modified:   src/__fixtures__/caps.ts
	modified:   src/__fixtures__/chat_config_thread.ts
	modified:   src/__fixtures__/chat_links_response.ts
	new file:   src/__fixtures__/msw.ts
	new file:   src/__fixtures__/tools_response.ts
	modified:   src/__tests__/ChatCapsFetchError.test.tsx
	modified:   src/__tests__/DeleteChat.test.tsx
	modified:   src/__tests__/PinMessages.test.tsx
	modified:   src/__tests__/RestoreChat.test.tsx
	modified:   src/__tests__/StartNewChat.test.tsx
	modified:   src/__tests__/UserSurvey.test.tsx
	new file:   src/components/Chat/Chat.stories.tsx
	modified:   src/components/Chat/Chat.tsx
	modified:   src/components/ChatContent/ChatContent.stories.tsx
	modified:   src/components/ChatContent/ChatContent.tsx
	modified:   src/components/ChatContent/ScrollToBottomButton.tsx
	modified:   src/components/ChatLinks/ChatLinks.tsx
	modified:   src/components/IntegrationsView/CustomFieldsAndWidgets.tsx
	modified:   src/components/IntegrationsView/IntegrationCard.module.css
	modified:   src/components/IntegrationsView/IntegrationCard.tsx
	deleted:    src/components/IntegrationsView/IntegrationCmdline/index.ts
	modified:   src/components/IntegrationsView/IntegrationDocker/IntegrationDocker.tsx
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationAvailability.tsx
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationForm.module.css
	modified:   src/components/IntegrationsView/IntegrationForm/IntegrationForm.tsx
	modified:   src/components/IntegrationsView/IntegrationsHeader.module.css
	modified:   src/components/IntegrationsView/IntegrationsHeader.tsx
	modified:   src/components/IntegrationsView/IntegrationsView.tsx
	renamed:    src/components/IntegrationsView/IntegrationCmdline/IntegrationCmdline.module.css -> src/components/IntegrationsView/IntermediateIntegration/IntermediateIntegration.module.css
	renamed:    src/components/IntegrationsView/IntegrationCmdline/IntegrationCmdline.tsx -> src/components/IntegrationsView/IntermediateIntegration/IntermediateIntegration.tsx
	new file:   src/components/IntegrationsView/IntermediateIntegration/index.ts
	modified:   src/components/IntegrationsView/icons/iconMap.ts
	new file:   src/components/SmartLink/SmartLink.module.css
	modified:   src/components/SmartLink/SmartLink.tsx
	modified:   src/components/Toolbar/Dropdown.tsx
	modified:   src/debugConfig.ts
	modified:   src/features/Chat/Chat.test.tsx
	modified:   src/features/Chat/Thread/actions.ts
	modified:   src/features/Chat/Thread/reducer.ts
	new file:   src/features/Integrations/renderIntegrationFormField.module.css
	modified:   src/features/Integrations/renderIntegrationFormField.tsx
	modified:   src/hooks/index.ts
	new file:   src/hooks/useGoToLink.ts
	new file:   src/hooks/useLinksFromLsp.ts
	new file:   src/hooks/useSmartLinks.ts
	modified:   src/services/refact/caps.ts
	modified:   src/services/refact/integrations.ts
	modified:   src/services/refact/tools.ts
	modified:   src/utils/index.ts
	new file:   src/utils/isAbsolutePath.ts
	modified:   src/utils/mockServer.ts
  • Loading branch information
MarcMcIntosh committed Dec 11, 2024
2 parents 00934f4 + 1af5a3d commit 17b20e2
Show file tree
Hide file tree
Showing 53 changed files with 1,806 additions and 727 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "refact-chat-js",
"version": "2.0.3-alpha.3",
"version": "2.0.3-alpha.4",
"type": "module",
"license": "BSD-3-Clause",
"files": [
Expand Down
350 changes: 318 additions & 32 deletions src/__fixtures__/caps.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,341 @@
import { CapsResponse } from "../services/refact";

export const STUB_CAPS_RESPONSE: CapsResponse = {
caps_version: 0,
cloud_name: "Refact",
code_chat_default_model: "gpt-3.5-turbo",
code_chat_models: {
"gpt-3.5-turbo": {
default_scratchpad: "",
endpoint_style: "openai",

endpoint_template: "https://inference.smallcloud.ai/v1/completions",

endpoint_chat_passthrough:
"https://inference.smallcloud.ai/v1/chat/completions",
tokenizer_path_template:
"https://huggingface.co/$MODEL/resolve/main/tokenizer.json",
tokenizer_rewrite_path: {
"o1-mini": "Xenova/gpt-4o",
"gpt-4-turbo-2024-04-09": "Xenova/gpt-4",
"Refact/1.6B": "smallcloudai/Refact-1_6B-fim",
"claude-3-5-sonnet-20240620": "Xenova/claude-tokenizer",
"gpt-4-turbo": "Xenova/gpt-4",
"qwen2.5/coder/1.5b/base": "Qwen/Qwen2.5-Coder-1.5B",
"text-embedding-3-small": "Xenova/text-embedding-ada-002",
"gpt-4": "Xenova/gpt-4",
"claude-3-5-sonnet-20241022": "Xenova/claude-tokenizer",
"claude-3-5-sonnet": "Xenova/claude-tokenizer",
"gpt-3.5-turbo-0125": "Xenova/gpt-3.5-turbo-16k",
"gpt-3.5-turbo": "Xenova/gpt-3.5-turbo-16k",
"gpt-4o-mini-2024-07-18": "Xenova/gpt-4o",
"gpt-4o-2024-08-06": "Xenova/gpt-4o",
"gpt-3.5-turbo-1106": "Xenova/gpt-3.5-turbo-16k",
"openai/gpt-4-turbo": "Xenova/gpt-4",
"gpt-4o-2024-05-13": "Xenova/gpt-4o",
"openai/gpt-4o-mini": "Xenova/gpt-4o",
"openai/gpt-4o": "Xenova/gpt-4o",
"gpt-4o-mini": "Xenova/gpt-4o",
"openai/gpt-4": "Xenova/gpt-4",
"gpt-4o": "Xenova/gpt-4o",
"openai/gpt-3.5-turbo": "Xenova/gpt-3.5-turbo-16k",
"cerebras-llama3.1-8b": "Xenova/Meta-Llama-3.1-Tokenizer",
"groq-llama-3.1-8b": "Xenova/Meta-Llama-3.1-Tokenizer",
"starcoder2/3b": "bigcode/starcoder2-3b",
},
telemetry_basic_dest: "https://www.smallcloud.ai/v1/telemetry-basic",

code_completion_models: {
"Refact/1.6B": {
n_ctx: 4096,
similar_models: [],
supports_tools: true,
supports_scratchpads: {
PASSTHROUGH: {
default_system_message:
"You are a coding assistant that outputs short answers, gives links to documentation.",
},
"FIM-SPM": {},
},
default_scratchpad: "FIM-SPM",
similar_models: ["Refact/1.6B", "Refact/1.6B/vllm"],
supports_tools: false,
supports_multimodality: false,
supports_clicks: false,
},
"test-model": {
"groq-llama-3.1-8b": {
n_ctx: 32000,
supports_scratchpads: {
REPLACE_PASSTHROUGH: {
context_format: "chat",
rag_ratio: 0.5,
},
},
default_scratchpad: "",
similar_models: [
"groq-llama-3.1-70b",
"groq-llama-3.2-1b",
"groq-llama-3.2-3b",
"groq-llama-3.2-11b-vision",
"groq-llama-3.2-90b-vision",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
"qwen2.5/coder/1.5b/base": {
n_ctx: 4096,
similar_models: [],
supports_scratchpads: {
"FIM-PSM": {
fim_prefix: "<|fim_prefix|>",
fim_suffix: "<|fim_suffix|>",
fim_middle: "<|fim_middle|>",
eot: "<|endoftext|>",
extra_stop_tokens: ["<|repo_name|>", "<|file_sep|>", "<|fim_pad|>"],
context_format: "qwen2.5",
rag_ratio: 0.5,
},
},
default_scratchpad: "FIM-PSM",
similar_models: [
"qwen2.5/coder/1.5b/base",
"qwen2.5/coder/3b/base",
"qwen2.5/coder/7b/base",
"qwen2.5/coder/14b/base",
"qwen2.5/coder/32b/base",
"qwen2.5/coder/0.5b/base/vllm",
"qwen2.5/coder/1.5b/base/vllm",
"qwen2.5/coder/3b/base/vllm",
"qwen2.5/coder/7b/base/vllm",
"qwen2.5/coder/14b/base/vllm",
"qwen2.5/coder/32b/base/vllm",
],
supports_tools: false,
supports_multimodality: false,
supports_clicks: false,
},
"gpt-4o": {
n_ctx: 32000,
supports_scratchpads: {
PASSTHROUGH: {
default_system_message:
"You are a coding assistant that outputs short answers, gives links to documentation.",
REPLACE_PASSTHROUGH: {
context_format: "chat",
rag_ratio: 0.5,
},
},
default_scratchpad: "",
similar_models: [
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"openai/gpt-4o",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
"gpt-4o-mini": {
n_ctx: 32000,
supports_scratchpads: {
REPLACE_PASSTHROUGH: {
context_format: "chat",
rag_ratio: 0.5,
},
},
default_scratchpad: "",
similar_models: ["gpt-4o-mini-2024-07-18"],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
},
code_completion_default_model: "smallcloudai/Refact-1_6B-fim",
code_completion_models: {
"smallcloudai/Refact-1_6B-fim": {
default_scratchpad: "FIM-SPM",
n_ctx: 4096,
similar_models: ["Refact/1.6B", "Refact/1.6B/vllm"],
supports_scratchpads: {
"FIM-PSM": {},
"FIM-SPM": {},
},
default_scratchpad: "FIM-SPM",
similar_models: ["Refact/1.6B", "Refact/1.6B/vllm"],
supports_tools: false,
supports_multimodality: false,
supports_clicks: false,
},
"groq-llama-3.1-70b": {
n_ctx: 32000,
supports_scratchpads: {
REPLACE_PASSTHROUGH: {
context_format: "chat",
rag_ratio: 0.5,
},
},
default_scratchpad: "",
similar_models: [
"groq-llama-3.1-70b",
"groq-llama-3.2-1b",
"groq-llama-3.2-3b",
"groq-llama-3.2-11b-vision",
"groq-llama-3.2-90b-vision",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
"starcoder2/3b": {
n_ctx: 4096,
supports_scratchpads: {
"FIM-PSM": {
context_format: "starcoder",
rag_ratio: 0.5,
},
},
default_scratchpad: "FIM-PSM",
similar_models: [
"bigcode/starcoderbase",
"starcoder/15b/base",
"starcoder/15b/plus",
"starcoder/1b/base",
"starcoder/3b/base",
"starcoder/7b/base",
"wizardcoder/15b",
"starcoder/1b/vllm",
"starcoder/3b/vllm",
"starcoder/7b/vllm",
"starcoder2/3b/base",
"starcoder2/7b/base",
"starcoder2/15b/base",
"starcoder2/3b/vllm",
"starcoder2/7b/vllm",
"starcoder2/15b/vllm",
"starcoder2/3b/neuron",
"starcoder2/7b/neuron",
"starcoder2/15b/neuron",
"starcoder2/3b",
"starcoder2/7b",
"starcoder2/15b",
"bigcode/starcoder2-3b",
"bigcode/starcoder2-7b",
"bigcode/starcoder2-15b",
],
supports_tools: false,
supports_multimodality: false,
supports_clicks: false,
},
},
code_completion_n_ctx: 2048,
endpoint_chat_passthrough:
"https://inference.smallcloud.ai/v1/chat/completions",
endpoint_style: "openai",
endpoint_template: "https://inference.smallcloud.ai/v1/completions",
running_models: ["smallcloudai/Refact-1_6B-fim", "gpt-3.5-turbo"],
telemetry_basic_dest: "https://www.smallcloud.ai/v1/telemetry-basic",
tokenizer_path_template:
"https://huggingface.co/$MODEL/resolve/main/tokenizer.json",
tokenizer_rewrite_path: {},
code_completion_default_model: "qwen2.5/coder/1.5b/base",
code_completion_n_ctx: 4000,
code_chat_models: {
"groq-llama-3.1-70b": {
n_ctx: 32000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: [
"groq-llama-3.1-70b",
"groq-llama-3.2-1b",
"groq-llama-3.2-3b",
"groq-llama-3.2-11b-vision",
"groq-llama-3.2-90b-vision",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
"gpt-3.5-turbo": {
n_ctx: 16000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: [
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-4",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"openai/gpt-3.5-turbo",
"openai/gpt-4",
"openai/gpt-4-turbo",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
"gpt-4o": {
n_ctx: 32000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: [
"gpt-4o-2024-05-13",
"gpt-4o-2024-08-06",
"openai/gpt-4o",
],
supports_tools: true,
supports_multimodality: true,
supports_clicks: false,
},
"gpt-4o-mini": {
n_ctx: 32000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: ["gpt-4o-mini-2024-07-18"],
supports_tools: true,
supports_multimodality: true,
supports_clicks: false,
},
"claude-3-5-sonnet": {
n_ctx: 32000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: ["claude-3-5-sonnet-20240620"],
supports_tools: true,
supports_multimodality: true,
supports_clicks: false,
},
"groq-llama-3.1-8b": {
n_ctx: 32000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: [
"groq-llama-3.1-70b",
"groq-llama-3.2-1b",
"groq-llama-3.2-3b",
"groq-llama-3.2-11b-vision",
"groq-llama-3.2-90b-vision",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
"gpt-4-turbo": {
n_ctx: 16000,
supports_scratchpads: {
PASSTHROUGH: {},
},
default_scratchpad: "",
similar_models: [
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-4",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"openai/gpt-3.5-turbo",
"openai/gpt-4",
"openai/gpt-4-turbo",
],
supports_tools: true,
supports_multimodality: false,
supports_clicks: false,
},
},
code_chat_default_model: "gpt-4o-mini",
running_models: [
"smallcloudai/Refact-1_6B-fim",
"Refact/1.6B",
"thenlper/gte-base",
"starcoder2/3b",
"qwen2.5/coder/1.5b/base",
"gpt-3.5-turbo",
"gpt-4-turbo",
"gpt-4o",
"gpt-4o-mini",
"claude-3-5-sonnet",
"groq-llama-3.1-8b",
"groq-llama-3.1-70b",
],
caps_version: 0,
};
Loading

0 comments on commit 17b20e2

Please sign in to comment.