Skip to content

Commit

Permalink
Merge pull request #20 from thisguymartin/0.1.12
Browse files Browse the repository at this point in the history
0.1.12
  • Loading branch information
thisguymartin committed Apr 30, 2023
2 parents c4bc67e + 3606f36 commit 4086170
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ hound --help
To use hound command:

```bash
hound search [search string]
hound [search string]
```

### Ask GPT

Ask GPT a question about a specific file:

```bash
hound search [...your question here]
hound [...your question here]
```

Example:

```bash
hound search "How to purge docker container and images?"
hound "How to purge docker container and images?"
```

## Setting Environment Variables
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "search_hound_ai"
version = "0.1.11"
version = "0.1.12"
description = "A CLI for GPT with a focus on simplicity and ease of use. For developer just wanting to use gpt in there command line."
authors = ["Martin Patino <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion search_hound_ai/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import typer

from dotenv import load_dotenv
from hound_client_commands import HoundClientCommands
from search_hound_ai.hound_client_commands import HoundClientCommands

load_dotenv()

Expand Down
12 changes: 2 additions & 10 deletions search_hound_ai/hound_client_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import typer

from search_hound_lib import SearchHoundLib
from search_hound_ai.search_hound_lib import SearchHoundLib


def HoundClientCommands(app: typer) -> typer :
@app.command()
Expand All @@ -11,13 +12,4 @@ def search(query: str):
search_response = SearchHoundLib.searchHound(query)
typer.echo(search_response, err=True, color=typer.colors.GREEN)

@app.command()
def openai_token_value(config: str):
"""
Store the OPENAI_API_KEY in the .env file.
"""
config_response = SearchHoundLib.storeOpenAIConfig(config)
typer.echo(config_response, err=True, color=typer.colors.YELLOW,)


return app
15 changes: 1 addition & 14 deletions search_hound_ai/search_hound_lib.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import os
import typer
import pkg_resources
from search_hound_ai.openai_lib import OpenAISearch

from openai_lib import OpenAISearch


class SearchHoundLib:
Expand All @@ -16,13 +13,3 @@ class SearchHoundLib:
def searchHound(search_string: str) -> str:
response: str = OpenAISearch(search_string)
return response
def storeOpenAIConfig(config: str):
if config is None or config == "":
return "OPENAI_API_KEY config provided"

filename = pkg_resources.resource_filename(__name__, "../.env")
text_file = open(filename, "w")
text_file.write('OPENAI_API_KEY=' + config)
text_file.close()

return "OPENAI_API_KEY ENV saved"

0 comments on commit 4086170

Please sign in to comment.