Skip to content

Commit 1c557cd

Browse files
committed
react to feedback
1 parent f1591cf commit 1c557cd

File tree

6 files changed

+23
-16
lines changed

6 files changed

+23
-16
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,37 @@ jobs:
3434
run: echo "${{ steps.inference.outputs.response }}"
3535
```
3636
37-
### Using a Prompt File
37+
### Using a prompt file
3838
3939
You can also provide a prompt file instead of an inline prompt:
4040
4141
```yaml
4242
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@v4
45-
4643
- name: Run AI Inference with Prompt File
4744
id: inference
4845
uses: actions/ai-inference@v1
4946
with:
5047
prompt-file: './path/to/prompt.txt'
48+
```
49+
50+
### Read output from file instead of output
51+
52+
This can be useful when model response exceeds actions output limit
53+
54+
```yaml
55+
steps:
56+
- name: Test Local Action
57+
id: inference
58+
uses: actions/ai-inference@v1
59+
with:
60+
prompt: 'Hello!'
5161

5262
- name: Use Response File
5363
run: |
54-
echo "Response saved to: ${{ steps.inference.outputs.response-path }}"
55-
cat "${{ steps.inference.outputs.response-path }}"
64+
echo "Response saved to: ${{ steps.inference.outputs.response-file }}"
65+
cat "${{ steps.inference.outputs.response-file }}"
5666
```
5767
58-
This is particularly useful for longer prompts or when you need to use the file
59-
path where the response is stored.
60-
6168
## Inputs
6269
6370
Various inputs are defined in [`action.yml`](action.yml) to let you configure
@@ -80,7 +87,7 @@ The AI inference action provides the following outputs:
8087
| Name | Description |
8188
| --------------- | ----------------------------------------------------------------------- |
8289
| `response` | The response from the model |
83-
| `response-path` | The file path where the response is saved (useful for larger responses) |
90+
| `response-file` | The file path where the response is saved (useful for larger responses) |
8491

8592
## Required Permissions
8693

__tests__/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('main.ts', () => {
6262

6363
expect(core.setOutput).toHaveBeenNthCalledWith(
6464
2,
65-
'response-path',
65+
'response-file',
6666
expect.stringContaining('modelResponse.txt')
6767
)
6868
})
@@ -101,7 +101,7 @@ describe('main.ts', () => {
101101
)
102102
expect(core.setOutput).toHaveBeenNthCalledWith(
103103
2,
104-
'response-path',
104+
'response-file',
105105
expect.stringContaining('modelResponse.txt')
106106
)
107107
})

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ inputs:
4242
outputs:
4343
response:
4444
description: The response from the model
45-
response-path:
45+
response-file:
4646
description: The file path where the response is saved
4747

4848
runs:

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function run(): Promise<void> {
7878

7979
// Save the response to a file in case the response overflow the output limit
8080
const responseFilePath = path.join(tempDir(), RESPONSE_FILE)
81-
core.setOutput('response-path', responseFilePath)
81+
core.setOutput('response-file', responseFilePath)
8282

8383
if (modelResponse && modelResponse !== '') {
8484
fs.writeFileSync(responseFilePath, modelResponse, 'utf-8')

0 commit comments

Comments
 (0)