Skip to content

Commit

Permalink
[docs][data/llm] Minor http docstring improvement (ray-project#50777)
Browse files Browse the repository at this point in the history
## Why are these changes needed?

Docstring improvements

## Related issue number

<!-- For example: "Closes ray-project#1234" -->

## Checks

- [ ] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

---------

Signed-off-by: Richard Liaw <rliaw@berkeley.edu>
  • Loading branch information
richardliaw authored and xsuler committed Mar 4, 2025
1 parent b6691a8 commit 5f05f3b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions python/ray/data/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,18 @@ class HttpRequestProcessorConfig(_HttpRequestProcessorConfig):
processor = build_llm_processor(
config,
preprocess=lambda row: dict(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "You are a calculator"},
{"role": "user", "content": f"{row['id']} ** 3 = ?"},
],
temperature=0.3,
max_tokens=20,
payload=dict(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "You are a calculator"},
{"role": "user", "content": f"{row['id']} ** 3 = ?"},
],
temperature=0.3,
max_tokens=20,
),
),
postprocess=lambda row: dict(
resp=row["choices"][0]["message"]["content"],
resp=row["http_response"]["choices"][0]["message"]["content"],
),
)
Expand Down

0 comments on commit 5f05f3b

Please sign in to comment.