-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docs: add language specifiers to fenced code blocks #6553
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
Open
anjalii-28
wants to merge
1
commit into
knative:main
Choose a base branch
from
anjalii-28:docs-codeblock-language-specifiers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,13 +31,13 @@ For convenience I have created a Github repository that contains scripts for an | |
|
|
||
| For local development it is recommended to enable port-forwarding for the Llama Stack server: | ||
|
|
||
| ```shell | ||
| ```bash | ||
| kubectl port-forward service/llamastackdistribution-sample-service 8321:8321 | ||
| ``` | ||
|
|
||
| Now your scripts can access it via `localhost:8321`: | ||
|
|
||
| ```shell | ||
| ```bash | ||
| http localhost:8321/v1/version | ||
|
|
||
| HTTP/1.1 200 OK | ||
|
|
@@ -58,7 +58,7 @@ _**Note:** The APIs of Llama Stack are fast evolving, but it supports a docs end | |
|
|
||
| Once all of the above is running you need to create your [Knative Functions](https://knative.dev/docs/functions/){:target="_blank"} project. We are using the CloudEvent template for the new [functions runtime for Python](https://github.com/knative-extensions/func-python){:target="_blank"}. | ||
|
|
||
| ```shell | ||
| ```bash | ||
| func create -l python -t cloudevents inference-func | ||
| ``` | ||
|
|
||
|
|
@@ -207,7 +207,7 @@ _**NOTE:** the docstrings were remove to keep the program compact._ | |
|
|
||
| We can now run our function locally by issuing `func run` on the command line. Once it is running there will a system log like below: | ||
|
|
||
| ```shell | ||
| ```bash | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would make this one just text |
||
| INFO:root:Functions middleware invoking user function | ||
| INFO:root:Connecting to LLama Stack | ||
| INFO:httpx:HTTP Request: GET http://localhost:8321/v1/models "HTTP/1.1 200 OK" | ||
|
|
@@ -221,7 +221,7 @@ Running on host port 8080 | |
|
|
||
| Now we can send a CloudEvent to the function, which contains our query for the AI model inference. In a new terminal of the function project we use `func invoke` for this: | ||
|
|
||
| ```shell | ||
| ```bash | ||
| func invoke -f=cloudevent --data='{"query":"Tell me a dad joke!"}' | ||
| Context Attributes, | ||
| specversion: 1.0 | ||
|
|
@@ -239,13 +239,13 @@ We see that the function was returning a different CloudEvent, which contains th | |
|
|
||
| To deploy the function to our `kind` cluster you need to install Knative Serving. The [Llama Stack Stack repo](https://github.com/matzew/llama-stack-stack){:target="_blank"} has a script for this as well. Once it is installed simply run: | ||
|
|
||
| ```shell | ||
| ```bash | ||
| func deploy --builder=host --build | ||
| ``` | ||
|
|
||
| This builds the function, using the `host` builder, pushes it to the container registry and eventually deploys it as a Knative Serving Service on Kubernetes: | ||
|
|
||
| ```shell | ||
| ```bash | ||
| 🙌 Function built: quay.io/<my-func-org>/inference-func:latest | ||
| pushing 100% |████████████████████████████████████████| (175/121 MB, 24 MB/s) [7s] | ||
| ✅ Function deployed in namespace "default" and exposed at URL: | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may make this one just text