Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨OpenAI and Ollama Clients #948

Closed
wants to merge 5 commits into from
Closed

✨OpenAI and Ollama Clients #948

wants to merge 5 commits into from

Conversation

fj0r
Copy link
Contributor

@fj0r fj0r commented Sep 15, 2024

  • Streaming output

  • The OpenAI interface employs the ai prefix for user-friendly input.

  • Option for controllable return values

  • Supports chat context retention

  • Customizable prompt functionality for ai do

    • Refer to prompt.nu for definition guidelines
    • Default model can be overridden using --model
    • line containing placeholders in the prompt can only include {} and quotation marks
  • Importing and exporting of Ollama models

  • Connection details managed through environment variables

Control some options with the following code.

$env.OLLAMA_HOST = 'http://localhost:11434'
$env.OPENAI_HOST = 'http://localhost:11434'
$env.OPENAI_API_KEY = 'secret'
$env.OPENAI_PROMPT = $env.OPENAI_PROMPT
| insert 'json2rust' {
    prompt: [
        "Analyze the following JSON data to convert it into a Rust struct:"
        "```{}```"
    ]
    model: '',
    description: 'Analyze JSON content, converting it into a Rust struct'
}

@fj0r fj0r changed the title OpenAI and Ollama Clients ✨OpenAI and Ollama Clients Sep 15, 2024
The commit adds a new feature to the AI prompt module. It introduces a 'git-diff-summary' functi
on which is designed to extract commit logs from git differences. This feature focuses on summar
izing only the content changes in files and ignores hash changes. The prompt template for this f
unction is included within the commit, showing how the summary should be structured. Additionall
y, a description is provided for the new functionality, explaining its purpose as a tool to summ
arize git differences.
@fdncred
Copy link
Collaborator

fdncred commented Sep 15, 2024

I'm sorry to say that I'm not really inclined to land any of your PRs because you tend to treat this repo as your own personal repo. Maybe you should create your own nushell repo and store your scripts there. I would be willing to have an entry pointing to that repo in our awesome-nu repo.

@fj0r
Copy link
Contributor Author

fj0r commented Sep 15, 2024

I need to know if the 'any' here includes content from fixes and upgrades in other modules. Even with regular updates, it takes a considerable amount of time. If it's just for my personal use, it's utterly unnecessary to waste that time.

@fj0r
Copy link
Contributor Author

fj0r commented Sep 15, 2024

Regarding the ‘new repo’ you mentioned, perhaps I failed to mention earlier that I do not work on nu_script professionally. Without a special reason, I cannot dedicate an unlimited amount of time to it, just as you cannot accept the current approach.

Of course, thank you for creating Nushell; it's indeed very useful and has provided me with tremendous assistance in many of my task workflows. I am also willing to contribute this part of the content. However, whether you choose to accept it or not is beyond my control.

@fdncred
Copy link
Collaborator

fdncred commented Sep 15, 2024

Regarding the ‘new repo’ you mentioned, perhaps I failed to mention earlier that I do not work on nu_script professionally. Without a special reason, I cannot dedicate an unlimited amount of time to it, just as you cannot accept the current approach.

Of course, no one's time is unlimited. I just think it would be easier for you because you're already forking and pushing to a repo. It's not much difference to push to your own repo and not ours. This way, you land your own PRs whenever you want and you don't have to deal with people like me. 😆

@fdncred fdncred closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants