Skip to content

Commit

Permalink
Merge pull request #26 from Codium-ai/docs/add-codebase-and-models
Browse files Browse the repository at this point in the history
Add documentation about Model Selection, Best Practices and Company Codebase
  • Loading branch information
almog-lv authored Nov 24, 2024
2 parents cf7b642 + a328e88 commit 71774e1
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 9 deletions.
3 changes: 3 additions & 0 deletions docs/chat/add-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Different context options include:
5. **Add an Image**
You can add an image as a context to your request. [Read more about adding images to the chat.](./images.md)

6. **Add Company Codebase**
You can add entire folders and files from your company's codebase as extra context, making your experience more relevant and tailored to your specific needs. Read more about adding images to the chat.

!!! alert "Please Notice"
In JetBrains, you can index up to 1,000 files in a single folder or project.

Expand Down
8 changes: 4 additions & 4 deletions docs/chat/chat-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ title: Chat History
# :fontawesome-solid-comments: Chat History

## Overview
Codiumate Chat maintains a history of your 20 most recent conversations, allowing you to review past interactions, refresh your memory, or explore new topics. You can continue a past chat to dive deeper into a topic or request additional information.
Qodo Gen Chat maintains a history of your 20 most recent conversations, allowing you to review past interactions, refresh your memory, or explore new topics. You can continue a past chat to dive deeper into a topic or request additional information.

## Using Chat History

1. **Initiate a Command:** Call a command by typing it in the chatbox.
2. **Continue the Conversation:** At the end of Codiumate's response, continue the conversation as long as you wish. Codiumate will maintain the context of your initial query, providing tailored responses to your follow-up questions.
3. **Start a new Conversation:** Click on the "New Chat" button on the top right of the chat interface to start a new conversation. Your current chat history will be cleared, and Codiumate will be ready to start a new conversation.
4. **Check your Chat History:** Next to the "New Chat" button, find the History button and click on it. The Chat History interface will open. You can see your latest 20 chats with Codiumate, switch to each one and continue the conversation if you wish.
2. **Continue the Conversation:** At the end of Qodo Gen's response, continue the conversation as long as you wish. Qodo Gen will maintain the context of your initial query, providing tailored responses to your follow-up questions.
3. **Start a new Conversation:** Click on the "New Chat" button on the top right of the chat interface to start a new conversation. Your current chat history will be cleared, and Qodo Gen will be ready to start a new conversation.
4. **Check your Chat History:** Next to the "New Chat" button, find the History button and click on it. The Chat History interface will open. You can see your latest 20 chats with Qodo Gen, switch to each one and continue the conversation if you wish.

Currently, your chat history wouldn't be saved between sessions, and will be deleted once you close VSCode. We are working on adding this feature in the future. Stay tuned!

Expand Down
1 change: 0 additions & 1 deletion docs/chat/coding-agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Qodo Gen's Coding-Agent
status: new
---


Expand Down
2 changes: 1 addition & 1 deletion docs/chat/commands/ask.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use the `/ask` command, follow these steps:

2. **Initiate the Command**: Type `/ask` followed by your question in the chat interface. Qodo Gen will process your query and return a response tailored to the context of your selected mode and focus.

3. **Continue the Chat**: If you require further assistance or have additional questions, continue your conversation in the same chat. Codiumate will maintain the context of your initial query, providing tailored responses to your follow-up questions.
3. **Continue the Chat**: If you require further assistance or have additional questions, continue your conversation in the same chat. Qodo Gen will maintain the context of your initial query, providing tailored responses to your follow-up questions.

!!! success "Available in"
- [:fontawesome-solid-file-code: Current File focus](../focus/current-file.md)
Expand Down
188 changes: 188 additions & 0 deletions docs/chat/commands/best-practices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
status: new
---

# `/generate-best-practices`

## Description

**Best Practices** helps your team follow coding guidelines by integrating them into Qodo Gen's suggestions. Use this feature to enforce consistency and quality across your project.

Use the `/generate-best-practices` command to generate a `best_practices.md` file. This is a generic file automatically generated by Qodo Gen. You can modify or completely replace it to include the specific guidelines you want your team to follow.

## How to Use
To use the `/generate-best-practices` command, follow these steps:

1. **Select Your Focus**: Before using this command, set a Focus. While the Focus does not influence the content of the generated `best_practices.md` file, Qodo Gen requires a Focus to be set in order to execute any command.

2. **Initiate the Command**: Type `/best-practices` in the chat interface. Qodo Gen will process your request and generate coding best practices and guidelines.

3. **Copy the Response as Markdown**: Click the three dots button in the top-right corner of Qodo Gen's response message, and select `Copy message as markdown`. Paste the markdown content into a new file named `best_practices.md`.

4. **Customize `best_practices.md`**: Modify the content of `best_practices.md` as needed. You can add new best practices, modify existing ones, or remove parts to better suit your team's requirements. You can also ask Qodo Chat to do that for you!

## The `best_practices.md` File

Qodo Gen automatically reads a `best_practices.md` file located at the root of your project directory. This file should contain guidelines and standards that your team should follow when coding.

### File Size Limit:

* The best_practices.md file can contain up to 1,500 lines.
* If the file exceeds this limit, Qodo Gen will process only the first 1,500 lines and ignore the rest.

### Example

!!! example "Best Practices File Example"
```
# Qodo Gen Best Practices

## General Code Structure

- **Consistent Naming Conventions**: Use descriptive and consistent naming for variables, functions, and classes. For example, use camelCase for variables and functions, and PascalCase for class names.

- **Documentation and Comments**: Ensure all functions, classes, and modules have comprehensive docstrings. Use the `/docstring` command to generate or improve documentation.

- **Code Modularity**: Break down large functions into smaller, reusable components. This enhances readability and maintainability.

## YAML Configuration

- **Navigation Structure**: Organize navigation in YAML files using nested lists for hierarchical structures. Ensure each section is clearly defined and logically grouped.

```yaml
nav:
- 'index.md'
- Installation:
- 'installation/index.md'
- 'installation/vscode.md'
```

- **Theme Customization**: Define custom themes and palettes in the YAML configuration to maintain a consistent look and feel across the documentation.

```yaml
theme:
name: material
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
```

## Markdown and Documentation

- **Use of Admonitions**: Utilize admonitions for highlighting important information, such as tips, warnings, and examples. Use custom icons and colors to differentiate types.

```markdown
!!! success "Available in"
- [:fontawesome-solid-file-code: Current File focus](../focus/current-file.md)
```

- **Image Integration**: Include images in documentation to enhance understanding. Use lazy loading for performance optimization.

```markdown
![example-image](./assets/example.png){loading=lazy}
```

- **Code Blocks**: Use fenced code blocks for syntax highlighting and clarity. Ensure code snippets are relevant and concise.

```python
def example_function(param1, param2):
"""Example function with parameters."""
return param1 + param2
```

## Python Scripting

- **Error Handling**: Implement try-except blocks to handle exceptions gracefully. Log errors for debugging purposes.

```python
try:
with open(file_path, 'r') as file:
content = file.read()
except FileNotFoundError as e:
print(f"Error: {e}")
```

- **Path Management**: Use `pathlib` for file and directory operations to ensure cross-platform compatibility.

```python
from pathlib import Path

docs_path = Path(__file__).parent / "docs"
```

## GitHub Actions

- **Workflow Configuration**: Define clear and concise workflows in `.yml` files. Use environment variables and secrets for sensitive information.

```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
```

- **Branch Management**: Use descriptive branch names for feature development and bug fixes. Automate pull request creation and notifications.

```yaml
- name: Create pull request
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

## Chat Commands

- **Command Usage**: Use chat commands to automate repetitive tasks such as generating commit messages or describing changesets.

```markdown
### Command:
`/commit`
```

- **Focus Selection**: Select appropriate focus modes (e.g., Current File, Git-Diff) to tailor command responses to the relevant context.

```markdown
- **Select Your Focus**: Choose between Current File or Git-Diff for contextually relevant responses.
```

## Test Generation

- **Behavior Analysis**: Leverage behavior analysis to identify and categorize test scenarios. Use the advanced panel for managing test generation.

```markdown
## Behavior Categories
- **Happy Path**: Ideal and expected use cases.
- **Edge Case**: Unusual or extreme scenarios.
```

- **Test Refinement**: Continuously refine and customize generated tests to align with project requirements. Use example tests to guide style and consistency.

```markdown
## Refining Your Tests
- **Manual Editing**: Directly edit test code for quick adjustments.
```

## CSS Customization

- **Custom Styles**: Define custom CSS rules for branding and visual consistency. Use CSS variables for easy theme adjustments.

```css
:root {
--md-primary-fg-color: #765bfa;
}
```

- **Responsive Design**: Ensure styles are responsive and adapt to different screen sizes. Use grid layouts for flexible content arrangement.

```css
.md-typeset .grid {
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
```

By adhering to these best practices, you can maintain a consistent and high-quality codebase that is easy to understand, extend, and maintain.
```


43 changes: 43 additions & 0 deletions docs/chat/company-codebase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- ---
title: Company Codebase
status: new
---
# :fontawesome-solid-file-code: Company Codebase
הסבר כללי על מה זה אומר, דוגמאות לאיך אפשר להשתמש בפיצ'ר הזה
context awareness, לשאול את אילנה
לתת דוגמאות לשאלות מעניינות שאפשר לשאול את הראג וכו. איפה כדאי להשתמש בו ואיפה לא?
היוזר יכול לשאול שאלות שהן חוצות ריפוזיטוריז
הצ'אט מחובר לכל הקודבייס של החברה
בהמשך: פילטרים פר קודבייס, פר פרונטאנד/בקאנד/שפה...
## Overview
Retrieval-Augmented Generation (RAG) is a technique that combines retrieval-based methods with generative models to enhance the quality and relevance of generated content. Qodo Gen uses RAG to better understand your company's codebase.
By leveraging your company's codebase, Qodo Gen gains deeper context about your projects, making your experience more relevant and tailored to your specific needs.
!!! pro "Pro feature"
This feature is available for Enterprise users only.
<!-- ## Using Company Codebase
To start using Company Codebase:
1. **Install the Github App**:
2. **Select Repositories**: Select the repositories you'd like to use as context. Read more on this page to learn more about indexing strategy. -->

<!-- ![Company's Codebase](https://www.qodo.ai/images/codiumate/companys-codebase.png){width=700, loading=lazy}
## Indexing Strategy
* **Focus on Specific Contexts:** Index folders or files relevant to your task (e.g., src, code completions). Avoid indexing the entire project.
* **Examples Folder:** Create an examples folder and add it to the context. This can be used to store good examples and improve the quality of responses.
* **External Code:** If you are using a new or undocumented API, create an "External code" folder in your project and add the source code there. This can be indexed to provide context for your questions and improve the answers dramatically.
## Example Usage
* **Template Generation:** Use RAG to generate templates for common tasks, such as creating a Kotlin class with logging. This can help standardize code across your project.
* **Avoiding Code Duplication:** Use RAG to check for code duplication by selecting the context of the current file and asking relevant questions. --> -->
1 change: 0 additions & 1 deletion docs/chat/focus/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Introduction to Focus Selection
status: new
---

# Introduction to Focus Selection
Expand Down
42 changes: 42 additions & 0 deletions docs/chat/model-selection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Model Selection
status: new
---

# :fontawesome-solid-list-check: Model Selection

## Overview

Unleash the full potential of AI.

Seamlessly switch between the world's most advanced AI models in real-time to get the best, most relevant chat experience for your query.

## Available Models

1. **GPT-4.0** - The gold standard for advanced reasoning. Reliable for everyday, iterative coding tasks requiring up-to-date knowledge.
2. **GPT-o1-preview** - Enhanced reasoning and extensive knowledge base. Ideal for planning, difficult debugging, and deep reasoning about code.
3. **GPT-o1-mini** - Lightning-fast coding specialist, optimized for efficiency. Best for quick
4. **Claude 3.5 Sonnet** - Anthropic's latest, built for precision. Ideal for everyday coding tasks with excellent flexibility and speed.
5. **Gemini 1.5 Pro** - Google's cutting-edge multimodel AI. Best suited for tasks that need the whole project in context, such as large-scale refactoring or generating project-wide documentation.

## Using Model Selection

Select a model from the dropdown menu on the bottom left below the chatbox.
The selected model will be used for your next query.

## Examples

!!! example "Selecting Models"
![Model Selection](https://www.qodo.ai/images/qodo-gen-gifs/ModelSelection.gif){width=700, loading=lazy}

!!! example "GPT-4.0"
![Model Selection](https://www.qodo.ai/images/qodo-gen-gifs/GPT4o.gif){width=700, loading=lazy}

!!! example "GPT-o1-preview"
![Model Selection](https://www.qodo.ai/images/qodo-gen-gifs/O1preview.gif){width=700, loading=lazy}

!!! example "Claude 3.5 Sonnet"
![Model Selection](https://www.qodo.ai/images/qodo-gen-gifs/sonnet35.gif){width=700, loading=lazy}

!!! example "Gemini 1.5 Pro"
![Model Selection](https://www.qodo.ai/images/qodo-gen-gifs/gemini15.gif){width=700, loading=lazy}
5 changes: 4 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ nav:
- Current File: 'chat/focus/current-file.md'
- Git Diff: 'chat/focus/git-diff.md'
- Add Extra Context: 'chat/add-context.md'
- Images: 'chat/images.md'
- Commands:
- 'chat/commands/index.md'
- /ask: 'chat/commands/ask.md'
Expand All @@ -43,9 +44,11 @@ nav:
- /issues: 'chat/commands/issues.md'
- /recap: 'chat/commands/recap.md'
- /changelog: 'chat/commands/update-changelog.md'
- /generate-best-practices: 'chat/commands/best-practices.md'
- Coding-Agent: 'chat/coding-agent.md'
- Chat History: 'chat/chat-history.md'
- Images: 'chat/images.md'
- Model Selection: 'chat/model-selection.md'
# - Company Codebade: 'chat/company-codebase.md'
- Code Completion:
- 'code-completion/index.md'

Expand Down
2 changes: 1 addition & 1 deletion overrides/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<div class="footer-links">
<a href="https://qodo-merge-docs.qodo.ai">Qodo Merge</a>
<p>|</p>
<a href="https://qodo-flow-docs.qodo.ai">Alpha Codium</a>
<a href="https://qodo-flow-docs.qodo.ai">Qodo Flow</a>
</div>
<div class="social-icons">
<a href="https://github.com/Codium-ai" target="_blank" rel="noopener" title="github.com" class="social-link">
Expand Down

0 comments on commit 71774e1

Please sign in to comment.