Skip to content

Feature/azure openai#42

Draft
lipkau wants to merge 4 commits intoTNG:mainfrom
lipkau:feature/azure_openai
Draft

Feature/azure openai#42
lipkau wants to merge 4 commits intoTNG:mainfrom
lipkau:feature/azure_openai

Conversation

@lipkau
Copy link
Copy Markdown

@lipkau lipkau commented Mar 26, 2024

No description provided.

Comment thread please.sh

export OPENAI_URL="${endpoint}/openai/deployments/${deployment-id}"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand - do you want to set endpoint and deployment ID every time you call please - or at least with every new terminal? Wouldn't that be a lot of work? We could also store these values somewhere on the disk, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saving to disk sounds like the right thing to do.
But as the script does not yet do so I didn't make assumptions on how to implement this, but rather start this conversation.

  1. how should we save to disk?
  • ~/.pleaserc
  • ~/.please/config
  • other?
  1. when implementing a config/storage on disk... is there anything of the current state to be migrated?
  • eg: debug or model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/.pleaserc seems like a good location.
I would not sabe model or debug since they are rather transient attributes you might want to change every invocation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, on Linux, we should respect $XDG_CONFIG_HOME (falling back to .config, if that env variable is not set) and put the config in something like $XDG_CONFIG_HOME/please/<whatever-we-want-to-call-the-config-file>.

Comment thread please.sh Outdated
checkMark="\x1B[31m\xE2\x9C\x93\x1B[0m"

openai_invocation_url=${OPENAI_URL:-"https://api.openai.com/v1"}
openai_use_azure_endpoint=$(echo "$OPENAI_URL" | grep azure.com >/dev/null && echo 1 || echo 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a bit brittle - should we rather set it wenn setting the OPENAI_URL as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather infer the information from the actually used endpoint url rather than keep the 2 settings in sync.
I can change the code to be more robust in a proper if block.
But if you prefer a setting on it's own (saved to disk), I can do that too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if we make it a bit more robust.

@thomas-endres-tng
Copy link
Copy Markdown
Contributor

I just reviewed the changes. I think the script could be a bit easier and it could also store the necessary attributes so you don't have to enter them so often.

@thomas-endres-tng
Copy link
Copy Markdown
Contributor

Did you also sign your commits?

@lipkau
Copy link
Copy Markdown
Author

lipkau commented Mar 26, 2024

Did you also sign your commits?

not yet.
I will sign, squash and write documentation before removing the draft state.

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