같은 API, TypeScript 모양
TS SDK 가 Python 의 surface 미러링하지만 TypeScript 친화 객체 인자. Python 이 model='...', contents='...' 를 kwarg 로 받는 곳에서 TypeScript 는 객체 한 개: { model, contents, config }.
response.text 는 property
Legacy SDK 에서 port 할 때 가장 큰 함정: response.text 는 property, method 아냐. response.text() 라고 쓰면 "string is not callable" 에러 받음.
Streaming 은 generateContentStream 사용
Streaming 함수 이름이 다르고 async iterable 직접 반환:
ai.models.generateContent(...)— single response, awaitable.ai.models.generateContentStream(...)— chunk 의 async iterable.
for await 로 stream 소비. 각 chunk 의 chunk.text 가 partial text.