repo_id stringclasses 46
values | file_path stringlengths 36 118 | content stringlengths 7 1.68M | __index_level_0__ int64 0 0 |
|---|---|---|---|
devchat_public_repos | devchat_public_repos/devchat/.flake8 | [flake8]
max-line-length = 100
ignore = E712,W503 | 0 |
devchat_public_repos | devchat_public_repos/devchat/.pylintrc | [BASIC]
good-names=id,db
[MESSAGES CONTROL]
disable=
missing-docstring,
broad-exception-caught,
too-few-public-methods,
too-many-instance-attributes,
too-many-arguments,
too-many-locals,
too-many-branches,
fixme,
R0801
[MASTER]
extension-pkg-whitelist=pydantic
| 0 |
devchat_public_repos | devchat_public_repos/devchat/LICENSE | Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
... | 0 |
devchat_public_repos | devchat_public_repos/devchat/pyproject.toml | [tool.poetry]
name = "devchat"
version = "0.2.10"
description = "DevChat is an open-source tool that helps developers write prompts to generate code and documentation."
authors = ["DevChat Team <hello@devchat.ai>"]
license = "Apache License 2.0"
readme = "README.md"
homepage = "https://github.com/devchat-ai/devchat"
cl... | 0 |
devchat_public_repos | devchat_public_repos/devchat/README.md | <div align="center">

# DevChat: Intelligent Scripts that Streamline Your Dev Workflows
[](http://makeapullrequest.com)
[![Circ... | 0 |
devchat_public_repos | devchat_public_repos/devchat/no_binary_install.sh | set -e
source $CONDA_PREFIX/etc/profile.d/conda.sh
# input target dir with shell script argument
if [ -n "$1" ]; then
TARGET_DIR=$1
else
# Error
echo "Please input a target dir with shell script argument"
exit 1
fi
mkdir -p $TARGET_DIR
conda remove -n devchat-no-binary --all --yes
conda create -n devc... | 0 |
devchat_public_repos | devchat_public_repos/devchat/poetry.lock | # This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
[[package]]
name = "anyio"
version = "4.3.0"
description = "High level compatibility layer for multiple asynchronous event loop implementations"
optional = false
python-versions = ">=3.8"
files = [
{file = "anyio-4.3.0-py3-n... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/store.py | # pylint: disable=import-outside-toplevel
from dataclasses import asdict
import json
import os
from typing import List, Dict, Any, Optional
from tinydb import TinyDB, where, Query
from tinydb.table import Table
from devchat.chat import Chat
from devchat.prompt import Prompt
from devchat.utils import get_logger
logger ... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/config.py | import os
import sys
from typing import List, Dict, Tuple, Optional
from pydantic import BaseModel
import oyaml as yaml
class GeneralProviderConfig(BaseModel):
api_key: Optional[str]
api_base: Optional[str]
class ModelConfig(BaseModel):
max_input_tokens: Optional[int] = sys.maxsize
provider: Optional... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/assistant.py | import json
import sys
import time
from typing import Optional, List, Iterator
from devchat.message import Message
from devchat.chat import Chat
from devchat.openai.openai_prompt import OpenAIPrompt
from devchat.store import Store
from devchat.utils import get_logger
logger = get_logger(__name__)
class Assistant:
... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/message.py | from abc import ABC, abstractmethod
from dataclasses import dataclass
@dataclass
class Message(ABC):
"""
The basic unit of information in a prompt.
"""
content: str = ""
INSTRUCT = "instruct"
CONTEXT = "context"
FUNCTION = "function"
CHAT = "chat"
@abstractmethod
def to_dict(... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/chat.py | from abc import ABC, abstractmethod
from typing import Iterator
from devchat.prompt import Prompt
class Chat(ABC):
"""
Chat interface for managing chat-related interactions.
This interface defines methods for prompting a chat system with
a list of Message objects and retrieving responses, either as a... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/utils.py | # pylint: disable=import-outside-toplevel
import logging
import os
import re
import getpass
import socket
import subprocess
from typing import List, Tuple, Optional
import datetime
import hashlib
log_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# pylint: disable=invalid-name
e... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/prompt.py | from abc import ABC, abstractmethod
from dataclasses import dataclass, field, asdict
import hashlib
from datetime import datetime
import sys
from typing import Dict, List
from devchat.message import Message
from devchat.utils import unix_to_local_datetime, get_logger, user_id
logger = get_logger(__name__)
@dataclas... | 0 |
devchat_public_repos/devchat | devchat_public_repos/devchat/devchat/__main__.py | import sys
if __name__ == "__main__":
from devchat._cli.main import main as _main
sys.exit(_main())
| 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/ide/service.py | # disable pylint
# pylint: disable=W0613
# pylint: disable=E1133
# pylint: disable=R1710
# pylint: disable=W0719
# pylint: disable=W3101
# pylint: disable=C0103
from typing import List
from .rpc import rpc_method
from .types import Location, SymbolNode, LocationWithText
from .vscode_services import selected_range, vi... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/ide/__init__.py | from .service import IDEService
from .types import *
from .types import __all__ as types_all
__all__ = types_all + [
"IDEService",
]
| 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/ide/types.py | from typing import List
from pydantic import BaseModel
__all__ = [
"Position",
"Range",
"Location",
"SymbolNode",
"LocationWithText"
]
class Position(BaseModel):
line: int # 0-based
character: int # 0-based
def __repr__(self):
return f"Ln{self.line}:Col{self.character}"
... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/ide/rpc.py | # pylint: disable=C0103
# pylint: disable=W3101
# pylint: disable=W0719
# pylint: disable=R1710
# pylint: disable=W0212
import os
from functools import wraps
import requests
BASE_SERVER_URL = os.environ.get("DEVCHAT_IDE_SERVICE_URL", "http://localhost:3000")
def rpc_call(f):
@wraps(f)
def wrapper(*args, **k... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/ide/vscode_services.py | import os
from .rpc import rpc_call
from .types import LocationWithText
@rpc_call
def run_code(code: str): # pylint: disable=unused-argument
pass
@rpc_call
def diff_apply(filepath, content): # pylint: disable=unused-argument
pass
@rpc_call
def get_symbol_defines_in_selected_code():
pass
def find_sy... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/ide/idea_services.py | from .types import LocationWithText
from .rpc import rpc_method
class IdeaIDEService:
def __init__(self):
self._result = None
@rpc_method
def get_visible_range(self) -> LocationWithText:
return LocationWithText.parse_obj(self._result)
@rpc_method
def get_selected_range(self) -> L... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/llm/text_confirm.py | # flake8: noqa: E402
from functools import wraps
from devchat.chatmark import Checkbox, Form, TextEditor
class MissEditConfirmFieldException(Exception):
pass
def edit_confirm(response):
need_regenerate = Checkbox(["Need Regenerate"])
edit_text = TextEditor(response)
feedback_text = TextEditor("")
... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/llm/tools_call.py | import json
import os
import sys
from functools import wraps
from devchat.memory import ChatMemory
from devchat.chatmark import Form, Radio, TextEditor
from devchat.ide import IDEService
from .openai import chat_call_completion_stream
class MissToolsFieldException(Exception):
pass
def openai_tool_schema(name,... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/llm/__init__.py | from .chat import chat, chat_json
from .openai import chat_completion_no_stream_return_json, chat_completion_stream
from .text_confirm import llm_edit_confirm
from .tools_call import chat_tools, llm_func, llm_param
__all__ = [
"chat_completion_stream",
"chat_completion_no_stream_return_json",
"chat_json",
... | 0 |
devchat_public_repos/devchat/devchat | devchat_public_repos/devchat/devchat/llm/openai.py | # flake8: noqa: E402
import json
import os
import re
from typing import Dict, List
import openai
from .pipeline import (
RetryException,
exception_handle,
exception_output_handle,
parallel,
pipeline,
retry,
)
def _try_remove_markdown_block_flag(content):
"""
如果content是一个markdown块,则删除... | 0 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3